How to flash Android 6.0 Marshmallow factory image on your Nexus 5, Nexus 6, Nexus 7, and Nexus 9

Android 6.0 Marshmallow

Earlier today, Google released the Android 6.0 Marshmallow factory images for the Nexus 5, Nexus 6, Nexus 7 2013), and the Nexus 9. While the company will soon roll out OTA updates for these devices as well, they can take up to a couple of weeks to be available for everyone.

So, if you want to immediately get Android 6.0 Marshmallow on your device, the fastest way to do so is by flashing its factory image. The steps can be a bit tedious for novice users and will completely erase all your important data from the device though, but if are desperate to get Marshmallow on your Nexus device now, this is the best way to do it.

Note: Backup all your important data including documents, data, photos, and videos from the device. The steps below will require you to unlock the bootloader of your device, which will wipe it completely clean. If you are rooted, you can use Titanium Backup to backup all your data, but it is strongly recommended that you don’t restore apps and their associated data after installing Android 6.0 Marshmallow since it can lead to compatibility issues.

Also, make sure that your Nexus has at least 50% of battery power before proceeding with the steps below.

Step 1: Download the Android 6.0 Marshmallow factory image for your Nexus device from here. Also, download the ADB/Fastboot files and the required drivers from below.

If you are using a Mac, extract the contents from the ADB/Fastboot ZIP file inside a new folder called ‘marshmallow’ on your desktop.

For Windows, users simply need to follow the instructions shown on the screen to install the ADB/Fastboot files on their PC. When prompted, make sure to install the them system wide. There is no need to install the drivers from ADB/Fastboot installer, since you will be installing them separately. Once ADB/Fastboot is installed, proceed to install the drivers on your PC.

Step 2: Open up a new Terminal or Command Prompt window and use the ‘cd’ command to navigate to the “marshmallow” 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

Alternatively, Windows users can simply Shift + right click on the folder name and select the ‘Open command prompt’ here option.

Step 3: If you own a Nexus 6 and Nexus 9, you first need to toggle the ‘Enable OEM unlock’ option from the hidden Developer menu. This option is not present on the Nexus 5 and Nexus 7, so owners of these devices don’t have to do anything.

Then proceed to switch off your device and reboot it into bootloader mode by using the key combination mentioned below

  • Nexus 5: Volume Up + Volume Down for a few seconds and then press Power button.
  • Nexus 6: Volume Down for a few seconds and then press the Power button.
  • Nexus 7 (2013): Volume Down for a few seconds and then press the Power button.
  • Nexus 9: Volume Down for a few seconds and then press the Power button.

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

fastboot devices

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

./fastboot devices

The above command will 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. You can also try restarting your PC and reinstalling the drivers to get your PC to detect your Nexus.

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

fastboot oem unlock

Make sure to confirm the selection on your device by pressing the Volume up button.

Android M installation

If your device does not automatically reboot after its bootloader is unlocked, it is recommended that you do so manually. Let the device boot back into Android, simply switch it off and then boot back into Recovery mode.

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


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


If the 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

Now sit back and relax as the script flashes the Android 6.0 Marshmallow factory image on your Nexus device partition by partition. Once flashed, your Nexus should automatically boot back into Android. If not,

The script will then automatically flash the Android 6.0 Marshmallow factory image on your Nexus device and reboot it automatically when done. If not, manually reboot your device. The first boot can take a significant amount of time — up to 15-20 mins — so be patient. If your device is still stuck at the boot logo after that, repeat the above steps again.

If you are facing any issues while installing the Marshmallow factory image on your Nexus device, drop in a comment below and we would be happy to help you out.