In this guide, we will show you the steps to format data/factory reset your Android device using ADB Commands. While the most generic way of formatting your device is by heading over to the Settings menu, but that might not be the most viable approach under all circumstances. For example, if your device is in a soft brick state or you are in the process of flashing a custom ROM, then you might not be able to access the OS in the first place.
Further inclining towards the custom development, the next best approach to get this job done is via the TWRP Recovery. However, nowadays, most custom ROMs come with their own recovery as well. So additionally installing TWRP on top of the existing RIOM would not only call for additional effort but could also lead to a few issues. Moreover, the support for TWRP is slowly declining as well, so there are quite a few devices that don’t have a working TWRP.
So your next best bet will be to boot your device to Fastboot Mode and use the fastboot -w command. This is generally the best way of getting the job done and I personally prefer this approach itself. But to carry out this process, you’ll need to have fastboot drivers installed beforehand. if you don’t want to do so, then your best bet is to format data/factory reset your Android device via the ADB Command. And in this guide, we will show you how to do just that. Follow along.
How to Format Data/Factory Reset Android via ADB Command
The below process will wipe off all the data from your device, so please take a complete device backup beforehand. Moroever, this process is not applicable to stock recovery, it will only work on AOSP recoveries, such as LineageOS Recovery, Pixel Experience Recovery, etc.
- To begin with, download and extract Android SDK Platform Tools on your PC.
- Then enable USB Debugging on your device and connect it to PC via USB cable.
- Now open CMD inside the platform-tools folder and type in the below command:
adb reboot recovery
- Finally, execute the below command to perform a factory reset:
adb shell recovery --wipe_data
- You may now reboot your device to the OS via the below command:
adb reboot
That’s it. These were the steps to format data.factory reset Android using ADB Commands. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.