Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I do factory reset using adb in android? [closed]

How can I do the factory reset in android using ADB command? I had used adb reboot recovery command to get reset. But third party applications couldn't be cleared somehow.Is it correct way to achieve using ADB?

Actually, I want to do factory reset android devices through java code. What can be solution here?

like image 826
Prashant Avatar asked Feb 04 '13 11:02

Prashant


People also ask

How do I use adb in recovery mode?

Connect the device to Mac or PC in recovery mode. Now open terminal/CMD in computer and go to platform-tools/. type and enter adb devices to check if the device is connected in recovery mode. Now type adb shell mount data and adb shell mount system to mount the respective directories.


1 Answers

You can send intent MASTER_CLEAR in adb:

adb shell am broadcast -a android.intent.action.MASTER_CLEAR 

or as root

adb shell  "su -c 'am broadcast -a android.intent.action.MASTER_CLEAR'" 
like image 72
0x8BADF00D Avatar answered Oct 21 '22 18:10

0x8BADF00D