How to Factory reset with ADB in Android

How to factory reset with the adb command.

1. How to Factory reset (wipe data)

You can request the recovery mode to delete the /data partition with the following command when enter recovery and perform factory reset. and then it will reboot and go to recovery mode with adb reboot recovery.

$ adb shell "recovery --wipe_data"
$ adb reboot recovery

2. recovery command options

You can use the following options with the recovery command:

* The arguments which may be supplied in the recovery.command file:
*   --send_intent=anystring - write the text out to recovery.intent
*   --update_package=path - verify install an OTA package file
*   --wipe_data - erase user data (and cache), then reboot
*   --wipe_cache - wipe cache (but not user data), then reboot
*   --set_encrypted_filesystem=on|off - enables / diasables encrypted fs

References

Related Posts

codechachaCopyright ©2019 codechacha