Android phones include a recovery partition with options for wiping data and restoring factory settings, but booting the recovery image from your Android isn’t always the most efficient method. Google provides the Android Debug Bridge command-line utility for accessing your device and executing commands without touching your phone. The ADB commands for performing a factory reset on your phone are for advanced users and not available on the Android Developers website. Instead, Google published these shell commands in the source-code comments of the recovery image.
Visit the Android Developers site to download the Android System Development Kit (see Resources). Right-click the ZIP archive and choose “Extract All.” Click “Browse” and choose your “C:\Program Files” directory.
Click the folder you extracted and press “F2” to rename it. Give the folder a simple, descriptive name, such as “AndroidADT.”
Related Reading: How to Clear a Previous Google Account From an Android Phone Without a Reset
Right-click “Computer” in your file browser and choose “Properties.” Click “Advanced System Settings” and, in the System Properties window, click “Environment Variables.”
Click “Path” and “Edit” in the System Variables window. When the Edit System Variable window opens, your path variable is selected, so press “End” to move the cursor to the end of the selection. If you type while the path is selected, you’ll erase your path variable.
Type “;C:\Program Files\AndroidADT\sdk\platform-tools\” (without quotes here and throughout) and ensure that you include the semicolon at the beginning of the path. Click “OK” to save your changes.
Point your cursor to the upper-right corner of the screen and click “Search.” Type “cmd” in the Search box and click the program icon in the search results to launch the Command Prompt window.
Turn on your Android phone and connect it to a USB port on your computer. Type “adb shell” and press “Enter.” When ADB connects to your device, type “–wipe_data” and press “Enter.” Your phone restarts in recovery mode and restores Android to factory settings.