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?
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'"