How to install the Android M developer preview on Nexus 5, Nexus 6 or Nexus 9

Android M

Google has just released the Android M developer preview images for the Nexus 5, Nexus 6, Nexus 9 and the Nexus Player. While Android M is not as big an update as Lollipop, Google has still released a developer preview build for it to make sure the final version of the OS has no major stability issues and is relatively bug free.

The developer preview images of Android M are basically factory images, so Nexus 5, 6 and Nexus 9 owners can easily install them using ADB/Fastboot. The whole process will completely wipe their device of all its data though, so it is recommended that they make a backup before proceeding with the steps below.

Additionally, being a developer preview, they are not meant to be used as a daily driver, and are strictly meant for developers and advanced users.

Step 1: Download all the files linked below and extract their contents inside a new folder called “android” on your desktop. To make it clear, all the files must be inside the same directory (android here) and not inside any other folder.

android-m-files

Step 2: Open up a new Terminal or Command Prompt window and use the ‘cd’ command to navigate to the “android” folder created in previous step on your desktop.

Eg code below in case you are not well versed with the ‘cd’ command:

cd USERNAME/desktop/android

Step 3: Switch off your Nexus 5, Nexus 6 or Nexus 9 and reboot it into bootloader mode using the key combination mentioned below

  • Nexus 5: Volume Up + Volume Down + Power
  • Nexus 6: Volume Down + Power
  • Nexus 9: Volume Down + Power

Step 4: Before flashing the factory image, you need to make sure that your Nexus device is being detected by the PC. Run the following command to confirm it.

fastboot devices

If you are using a Mac, then you need to prefix a “./” before every Fastboot command. So, the above command will look something like this on a Mac -:

./fastboot devices

The above command should confirm if your device is indeed being detected by your PC or not. If it is, then proceed to the steps below. If not, repeat the above steps again. Make sure to check that you have properly installed the drivers and that all the files are inside the correct folder.

Step 5: Unlock the bootloader of your Nexus device by executing the below command.

fastboot oem unlock

Make sure to confirm the selection on your Nexus device pressing the Volume up button. Once the bootloader has been unlocked, proceed to the next step.

Android M installation

Step 5: If you are running Windows, copy-paste the following command in the Terminal/command prompt window -:

flash-all.bat

On a Mac, copy-paste the following command -:

./flash-all.sh

If the flash-all.sh script gives you a fastboot not found error on your Mac, open up the file in Text Edit and add a “./” before every fastboot command.

Android M

The script will then automatically flash the full factory image on your Nexus device after which it will automatically reboot. Keep in mind that the first boot is going to take an extremely long time, so be patient and don’t start panicking,  thinking you have bricked the device.