Waiting is never fun, and this time Google made sure folks with a Nexus 10, Nexus 7, Nexus 4 and GSM Galaxy Nexus don't have to. Once you've done this, you're left with a clean, factory-style device -- this means everything is erased and all your pictures, music and everything else is gone. Back that all up before you start!
[WARN]Make sure your bootloader is unlocked. Check your device section for more help. You can't continue with a locked bootloader![/WARN]
The process is actually pretty simple, and setting up your Windows computer is the hardest part. Let's dig in.
I. - Set up adb and fastboot on your computer
This isn't really hard, but it's often device specific (Windows drivers and all that) so if you need any help, check the hacking sub-forum for your device. The gist of it is:
- Install adb and fastboot drivers in you're using Windows
- Install the adb and fastboot binaries from the Android SDK for your platform (Win, Mac and Linux are supported)
- adjust your PATH parameter or keep track of where you've installed adb and fastboot.
Once that's done, you've finished half the battle.
II. Download the factory image for your device
You can find them all here: Factory Images for Nexus Devices. Once you've downloaded it, you need to unpack the tar file. On Windows, use a program like 7-zip. On a Mac or a Linux computer, the included archive tool will extract them.
Once extracted, place the content of the folder in the same directory you have the fastboot binary installed. Keep the same file names.
III. Boot to the bootloader, and flash the images
Connect your Nexus to your computer via the USB port. Make sure you have USB debugging enabled. See here for more information about that.
Once connected, open the terminal or command prompt on your computer. Make sure you're in the folder where you have the fastboot binary and the files from the factory image download. While your phone is connected, run the following command:
Windows:
Code:
adb devices
Mac and Linux:
Code:
./adb devices
Look at the screen on your Nexus. You will have to authorize the USB connection if this is the first time you've connected your phone to your computer with debugging enabled. Choose YES to authorize it.
Your command line should return a serial number telling you everything is connected and communicating. If it doesn't, ask for assistance in your device section -- there are plenty of folks there who can help. If it does show you the serial number, proceed to the next step.
At the command line, enter the following command to boot into the bootloader:
Windows:
Code:
adb reboot-bootloader
Mac and Linux:
Code:
./adb reboot-bootloader
Don't unplug anything. Your Nexus should reboot into the bootloader, and you'll see the green robot and colorful text on a black screen. This is what you want.
Next, try this command to see if fastboot is set up correctly.
Windows:
Code:
fastboot devices
Mac and Linux:
Code:
./fastboot devices
As before, you're looking for the device serial number. If you don't see it, hit your device section. This is always the trickiest part when using Windows. If you see the serial number, carry on.
Look at the files you extracted from the image download. You're looking for the following: flash-all.bat (Windows) or flash-all.sh (Mac and Linux). These are the scripts that will flash the new boot image, system image, radio, or whatever other image files are needed for your device. Once you start them, never unplug your phone or interrupt the process in the command line!
If you're using Windows, enter the following in your terminal:
Code:
flash-all.bat
If you're using a Mac or Linux, use this command:
Code:
./flash-all.sh
You'll see all sorts of scrolling text, and your Nexus will restart at least once. You'll know when it's done because your command line will tell you it's finished and return you to the prompt.
[TIP]Protip: If you open the flash-all scripts with a text editor, you can see the individual commands they carry out. If you're familiar with scripting for your platform, you can modify these a little. Often folks will change the -w switch in the last command to keep their device from getting wiped clean. Do this sort of thing at your own risk, especially on the Nexus 7. You'll see it's flashing script is a little different than the others and it requires a bit more wiping and erasing your partitions. Per personal conversation with JBQ, this should be done every time you reinstall the factory images to your N7.[/TIP]
As usual, all the warnings about bricking devices and taking responsibility for your actions apply. Don't attempt this if you don't understand these instructions -- it's not worth bricking your Nexus because you were impatient.
Have fun, and good luck!
Last edited: