- Common understanding and experience using tools that are provided with the Android SDK such as Fastboot and ADB.
- Fastboot and ADB installed on your system and PATH variables updated accordingly.
- Understand that this will wipe all of your device data and that you will first need to backup any files, apps, etc that you do not want to lose!
- You will also obviously need a Nexus 5, Nexus 6, Nexus 9 or Nexus Player. Do not try any images on devices they are not intended for as it will cause issues and not work!
Step 1 – Unlock your bootloader in Developer options
Please continue to the next step if you already have your bootloader unlocked. If not, or you forget whether or not it’s unlocked, I will walk you through the process.
Enable OEM unlocking (aka unlock your bootloader)
- Go into Settings -> Developer options on your device.
If you do not see Developer options listed in this list, please click on About phone and keep tapping on Build number until you see “You are now a developer”. What this means is you now have a Developer options in your main Settings list. Please go to Settings -> Developer options now.
- Once you are in Developer options, look for OEM unlocking. This is a simple switch or checkbox that you need to enable. It will prompt you to Allow OEM unlocking and give you a warning message. Please click the enable to accept and continue.
Step 2 – Download your Nexus specific image
Below are direct links to download the Android M preview images. Please make sure you download the correct one to avoid any major issues.
Step 3 – Decompress the image file
All of the necessary image files that you will need are located in this “tgz” compressed file.
You will need to install a third-party tool to extract this gzip tar file and we recommend 7-zip. It’s free and works great but does NOT treat .tar.gz extract as one atomic operation. You will first extract the main .tgz file and the result will be a .tar file. Use 7-zip again to extract one more level and you will now see actual files.
If you already setup 7z as a system path variable, you can use one command in command prompt (aka cmd.exe) for this (obviously update the path and names as needed):
7z e volantis-MPZ44Q-preview-d15ad483.tgz && 7z x volantis-MPZ44Q-preview-d15ad483.tar
Mac and Linux Users
Using tar which is built in to OS X, open the terminal and you can extract using one command:
tar -zxvf volantis-MPZ44Q-preview-d15ad483.tar.gz
Below is what you should see once you have files extracted.
Depending on which device you are flashing, you may see slightly different files. For example, the Nexus 6 (shamu) will contain a zip file and an extra radio file. The batch script will also have a few differences from lets say, the Nexus 9 (volantis). On Windows if you are flashing the Nexus 6… please pay extra attention to the Update for Windows users below.
Step 4 – Reboot bootloader and flash
Assuming that you have fastboot and adb already set up and ready to use, just follow the commands below in order.
adb reboot bootloader
This will restart your phone into the bootloader mode. This will only work if your phone is connected and you have USB debugging turned on.
fastboot oem unlock
If your phone is already OEM Unlocked, you would not have to do this, but it wouldn’t hurt if you are unsure.
This will run all of the fastboot commands needed for the complete image flash. If you are using Windows, rather than a bash script you will use the flash-all.bat (batch) file. One common issue of this not working is that you do not have fastboot setup properly and is not set as an environment variable (a variable that works system wide).
Update for Windows users
There are reports from some Windows users that the flash-all.bat fails. It seems that it’s a bug with the fastboot.exe and how it inefficiently allocates memory. Some users say to try a different usb port or different usb cable, which they claim doing so solved their issues. If this works for you, please let us know in the comments below. Otherwise, please follow the workaround below that KingofPing has provided that will most likely solve your issues. What this does is break down each step manually that the batch file should have automatically done for you. (if you open the batch file in a text editor, you will see these same commands)
Make sure that if you have an extra zip file in your directory that you extract it and place it’s contents in your working directory.
After flash-all.bat errors out, please follow these instructions:
—Don’t “press any key” – that will close the window – just hit Ctrl-C.—
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
Once the scripts finish it will do a final reboot and the only thing left is to complete the normal Android setup wizards and enjoy. If you have any issues feel free to comment and we will help you out as needed!
If you are testing on your device make sure you help the Android community out and post any bugs you find. You can share your experiences over at AndroidForums.com, or join the Dev community over on G+ to stay involved.