I am trying to factory data reset my Oppo neo 7 (Android 5.1) using adb shell. Any ways i can try and links to adb shell? thanks


You can try the following commands:

To enter the fastboot mode:
adb reboot bootloader

Check whether the mobile phone is also in fastboot mode: fastboot devices

To delete the data: fastboot erase userdata

To delete cache: fastboot erase cache

Source and more detailed instructions click here.

| improve this answer | |
  • What if the device doesn't support Fastboot commands? – esQmo_ May 31 '17 at 10:58
  • good point. Then your solution will need to be used. Many devices support fastboot commands, so I think this is a good option in most cases. – user221603 May 31 '17 at 11:16

You need:

Open the folder where Minimal ADB & Fastboot, launch it.

Now on your phone, enable USB Debugging then connect to the computer.

On the terminal window, type

adb devices [press enter]

You should see something like: xxxxxxxxx device detected

Type adb shell [press enter]

Type recovery --wipe_data [press enter] |

Or, if the above doesn't work:

type wipe data[press enter]

Your phone should restart and begin the restoration process.

You can also simply boot into the recovery then perform the reset manually.

Type: adb reboot recovery [press enter]

| improve this answer | |
  • "Type recovery --wipe_data [press enter]" - when? After you executed adb devices, you're still in Windows command prompt and not in adb shell. Is there a step missing? – Andy Yan May 31 '17 at 11:27
  • adb reboot recovery --not working – JSONParser Mar 10 '18 at 8:40
  • You must enable USB Debugging in the Developer's option to get ADB commands working. – esQmo_ Mar 10 '18 at 9:33
  • @andy yan corrected – esQmo_ Mar 10 '18 at 9:35
  • 1
    Worked for me! I had a Xiaomi Redme 7A, Android 9.0, which I had corrupted so badly I couldn't do a factory reset through Settings. So I went through your options. First adb shell and then recovery wipe_data, and got "... recovery: not found". Ditto for wipe data. Then I tried adb reboot recovery and the device responded (Joy!!!), and gave me a short sequence of confirmation dialogs, driven from the Volume Up/Down and power keys, and then did with the reset. The device was NOT in fastboot mode. It was just attached to the USB, with normal developer options enabled. – Stephen Hosking Jul 10 at 3:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.