Mobile Tech & Devices ADVANCED Android (ADB) ⏱️ 5 min read 📅 Updated: 19 Sep 2026

How to Restore Factory Settings for a Non-Booting Android Phone Using ADB Commands

This guide details the advanced process of performing a factory reset on an Android device that is unable to boot into the operating system, utilizing the Android Debug Bridge (ADB) toolset.

Gurveer Singh
Gurveer Singh ✓ Verified Specialist
Founder & Chief Architect · hSECURITIES Labs
⚡ FAST-TRACK PROTOCOL

Direct Diagnostic & Remediation Summary

  • Prerequisite Check: Ensure ADB and Fastboot tools are installed and recognized by your computer.adb devices.
  • Connect Device: Connect the non-booting phone to the PC via USB cable.
  • Execute Wipe Command (Fastboot): If ADB fails, switch to Fastboot mode and run the wipe command: fastboot erase userdata.
🛠️ Tools & Prerequisites: 1. A computer (Windows, macOS, or Linux). 2. USB Debugging enabled on the Android device (if possible, otherwise physical access is limited). 3. ADB (Android Debug Bridge) and Fastboot tools installed and configured in your system's PATH. 4. The phone must be connected via a reliable USB cable.

How to Restore Factory Settings for a Non-Booting Android Phone Using ADB Commands

When an Android device enters a boot loop, crashes immediately on startup, or displays critical system errors, traditional methods of factory resetting (like using the physical buttons) may fail. This advanced procedure uses the command line interface (CLI) tools—ADB and Fastboot—to force the device into a state where it can be reset remotely.

🔍 Root Cause & Diagnostic Overview: A non-booting Android phone usually indicates corruption in core operating system partitions (like the System or Userdata partition), failed firmware updates, or critical software conflicts preventing the OS from loading. Since the GUI is inaccessible, we must communicate with the device at a lower level—the bootloader interface, accessed via Fastboot mode, which allows direct filesystem manipulation without booting the full OS stack.
STEP 1

Initial Triage & Environment Isolation

Before wiping data, we must confirm connectivity and determine if ADB or Fastboot is the appropriate tool. This step validates that your PC can communicate with the phone in a low-level mode.

  • Verify ADB Connection: Open your terminal/CMD and run adb devices. If it lists the device serial number, basic communication is established.
  • Enter Bootloader Mode (Fastboot): For most modern phones, you must force entry into Fastboot mode using a combination of hardware buttons (e.g., Volume Down + Power). Once in this screen, run adb reboot bootloader or sometimes simply use the physical button sequence to ensure ADB recognizes the change.
  • Verify Fastboot Connection: Run fastboot devices. A successful output listing the device serial number confirms readiness for partition commands.
STEP 2

Diagnostic Scans & Data Backup Attempt (If Possible)

While a full factory reset is required, it is prudent to check if any user data can be retrieved or if the issue is isolated. This step attempts read-only diagnostics.

  • Check System Logs: Attempting adb logcat might provide clues, although this often fails on deeply corrupted devices.
  • Identify Device Model Specifics: Note the manufacturer (Samsung, Google Pixel, Xiaomi) as specific vendor tools or bootloader quirks may apply. Some manufacturers require proprietary flashing tools alongside standard ADB/Fastboot.
  • Flash Necessary Images (Advanced): If you suspect a specific partition failure (e.g., radio), advanced users might need to flash manufacturer-provided factory images, but this is beyond basic resetting and requires root access or official firmware packages.
STEP 3

Targeted Remediation: Factory Data Wipe

This is the irreversible step that wipes all user data, returning the phone to its original out-of-box state. We use Fastboot commands as they operate at a lower level than ADB.

  • Execute Data Wipe Command: Run the following command in the terminal while connected to the device in Fastboot mode. This erases the user data partition entirely.fastboot erase userdata
  • Wipe Cache (Recommended): To ensure no corrupted temporary files interfere, wipe the cache partition as well:fastboot erase cache
  • Reboot to System: After wiping, instruct the device to reboot normally. The phone will now proceed through its initial setup wizard.fastboot reboot
TROUBLESHOOTING

Common Pitfalls & Advanced Diagnostics

If the above steps fail, consider these common pitfalls:

  • Error: 'device not found': The phone might be stuck in a mode that ADB/Fastboot cannot see. Cycle power multiple times or try different USB ports/cables.
  • Error: 'failed to execute command': This often means the device is locked down, requiring an official carrier unlock code or OEM unlocking sequence not covered here.
  • Alternative Wipe Method (If Fastboot Fails): Some older devices might require using adb shell wipe data if they support it via ADB rather than Fastboot.
FINAL STEP

Verification, Results & Long-Term Stability Validation

The successful execution of fastboot reboot indicates the system has loaded enough to begin setup. To validate success:

  • Initial Setup Check: The phone should display the manufacturer's welcome screen, prompting for language selection—this confirms a clean boot sequence.
  • Post-Reset Functionality Test: After completing setup, test core functions: Wi-Fi connectivity, camera access, and application installation. If these work flawlessly, the factory reset was successful.
  • Preventative Maintenance Tip: Always keep your Android OS updated through official channels to patch security vulnerabilities that could cause future boot failures. Never sideload major system updates from untrusted sources.
Resolution Complete: By executing the fastboot erase userdata command and subsequently rebooting, you have successfully restored the device to its factory state without requiring a functional operating system GUI. If the phone still fails to boot after this sequence, the issue is likely hardware failure (e.g., eMMC chip) rather than software corruption.

Frequently Asked Questions

  • Q: Can I use ADB if Fastboot commands fail?
  • A: Generally, no. ADB communicates with the running OS environment; Fastboot communicates directly with the bootloader partitions, which is necessary when the OS cannot load.
  • Q: Does this process erase my IMEI or phone number?
  • A: No. This procedure only wipes user data and system settings. The underlying hardware identifiers (like IMEI) remain untouched.
  • Q: What if the phone is locked by Google/Carrier FRP?
  • A: Factory resetting bypasses OS corruption but does not remove Factory Reset Protection (FRP). You will still need the previous owner's credentials or a proper carrier unlock code to set up the device fully.
COMMAND LINE / TERMINAL
adb devices
fastboot devices
fastboot erase userdata
fastboot erase cache
fastboot reboot

Frequently Asked Questions

Can I use ADB if Fastboot commands fail?

Generally, no. ADB communicates with the running OS environment; Fastboot communicates directly with the bootloader partitions, which is necessary when the OS cannot load.

Does this process erase my IMEI or phone number?

No. This procedure only wipes user data and system settings. The underlying hardware identifiers (like IMEI) remain untouched.

What if the phone is locked by Google/Carrier FRP?

Factory resetting bypasses OS corruption but does not remove Factory Reset Protection (FRP). You will still need the previous owner's credentials or a proper carrier unlock code to set up the device fully.

Engineering Assistance

Need help implementing this solution?

Our cybersecurity and infrastructure engineers can audit, harden, or configure your systems directly.

Request Technical Assistance →
Gurveer Singh
Gurveer Singh ✓ Verified Author
Founder & CEO at hSECURITIES | Cybersecurity Educator | Security Researcher | Ethical Hacking Enthusiast | Technology Mentor
Meet the Founder →

Gurveer Singh Saggu is the Founder and CEO of hSECURITIES, a cybersecurity and technology education platform focused on practical learning, digital security awareness, hardware diagnostics, Linux administration, and real-world cybersecurity training.

With a strong passion for technology, ethical hacking, and security education, he has spent years helping students, professionals, and organizations understand modern cyber threats and develop practical technical skills. Through hSECURITIES, he creates hands-on learning resources, technical guides, security awareness content, and community-driven initiatives that make cybersecurity more accessible.

His mission is to bridge the gap between theoretical knowledge and practical implementation by providing step-by-step learning experiences, technical troubleshooting resources, and security-focused educational platforms.

Community Discussion & Confirmations (0)

Technical questions, hardware findings, and verified fix reports.

No reader questions posted yet. Have you tried this solution or experienced an edge case? Post below.

Ask a Question or Share Solution