Skip to main content

How to install the Android M (Marshmallow) Developer Preview on your Nexus device

Android M Hands On
Malarie Gokey/Digital Trends
Google has announced the Android M Developer Preview, which means that although it’s not quite ready for the public just yet, you can try the early version out for yourself if you have a compatible Nexus device, a little technical know-how, and our handy guide. Google is offering the preview for the Nexus 5, Nexus 6, Nexus 9, and the Nexus Player.

Before jumping in, there are a few important things to remember. This software is a developer preview, which means that it will have more than a few bugs that could spoil your day. If that sounds annoying, then it may not be for you. However, if you want to live life on the cutting edge with Android M, that’s the price you’ll have to pay. The good news is that if you want to revert back to Android 5.0 Lollipop, you can do so quite easily.

Recommended Videos

Also, the process may erase all the data stored on your Nexus device, so make sure you have everything that is important to you backed up. This is because it must have an unlocked bootloader to install Android M, and that requires a factory reset, hence the data wipe. However, if the bootloader is already unlocked, your data will remain on the device. To be on the safe side, regardless of what method you use, we still recommend that you backup your data, just in case of disaster.

It might seem like a daunting task to flash a new OS on your phone or tablet, and while there are other guides online, they assume you already know what you’re doing, exasperating the situation. We decided to offer something more comprehensive that will especially help the newbies.

Installing ADB and Fastboot

In order to flash a system image, you must have ADB and Fastboot installed. ADB stands for Android Debug Bridge and it allows you to send commands to your Android device over USB through a terminal/command-line interface such as Windows Command Prompt. Fastboot allows you to flash images to your Android device.

There are two methods to getting ADB and Fastboot on your computer. The first is to download and install the Android SDK, but it includes a lot more than what you really need. This method will work for both Windows and Mac machines. If you’re a Windows user, and assuming you don’t plan on developing apps, you can download and install Minimal ADB and Fastboot instead, which will give you just the necessary files.

If you decide to go down the route of installing the full SDK, ADB and Fastboot will be in the C:program files (x86)androidandroid-sdkplatform-tools folder in Windows. If you use Minimal ADB and Fastboot, you can choose the directory you want.

Download the Android M Developer Preview system image

Now it’s time to grab Android M Developer Preview, and it’s available through Google’s Android Developers siteJust make sure to select the version that matches your device. This is very important, because you must flash the Nexus 5 image on a Nexus 5. A Nexus 6 image won’t work on a Nexus 5.

Having made sure, scroll down to the Hardware System Images section, accept the Terms and Conditions, and the download will begin.

google_developers_android_m_developer_preview_listing_version_3_screenshot_03
Image used with permission by copyright holder

Extracting the contents of the system image

The downloaded file should have .tgz as its extension and you need to extract the contents before going further. The best thing to do is download and install 7 Zip. There is an unofficial version for Macs as well. Once 7 Zip is installed on your machine, follow these steps:

  1. Open the 7 Zip File Manager and navigate to the folder that you saved the .tgz file in.
  2. Double click on the .tgz file.
  3. You will now see a file with a .tar extension.
  4. Double click on this file to show the contents (this will take about a minute or more).
  5. After it has opened, you should have a folder with the codename of your device as part of the title (ex. hammerhead for Nexus 5), Double click on it.
  6. You should now see a collection of files. Select all of them and click on Extract to extract all the contents. Type in the destination C:program files (x86)androidandroid-sdkplatform-tools (if you installed the full SDK) or whatever directory ADB and Fastboot are installed in.

Enable USB debugging and connecting your Nexus device via USB to your desktop

Developer_Options_USB_Debugging_OEM_Unlock_Screenshot
Image used with permission by copyright holder

Now you need to make sure USB debugging is enabled on your Nexus device. Open Settings on your Nexus device. If  you do not see Developer Options towards the bottom of the Settings screen on your device, follow these steps to activate them. Careful, they’re a little complicated.

  1. Tap on About Phone and find the Build Number.
  2. Tap on the Build Number seven times and the Developer Options will appear on the main page of the Settings.
  3. Tap on the Back key to see the Developer Options.
  4. Tap on Developer Options.
  5. Check to enable USB Debugging.
  6. If you’re Nexus device does not have an unlocked bootloader, then you also need to turn on OEM Unlocking, which can be found a little above the USB Debugging option.

Before you connect your device to the USB port on your computer, you want to make sure you have the appropriate drivers installed. You can grab them here. Since you’re working with a Nexus device, you specifically want the Google USB Drivers.

Now connect your device via a USB cable and you are ready to flash the Zip file that you extracted earlier. If you’re connecting your Nexus device to your computer for the first time, you will get a pop up box on your Nexus device stating what the computer’s RSA Key is. Just check Always Allow From This Computer and tap on OK.

Nexus_5_RSA_Key_Approval_Screenshot
Image used with permission by copyright holder

If your computer does not recognize your Nexus device, then open the notification panel and select USB For Charging Only and change the mode to Transfer Photos (PTP).

Nexus_5_USB_Switch_To_PTP_Screenshot
Image used with permission by copyright holder

If your computer still doesn’t recognize your Nexus device, see the USB connectivity issues section for further instructions.

Flashing the Android M Developer Preview

If you’re device doesn’t have an unlocked bootloader, follow the instructions below. 

This process will require a factory reset so make sure you have your important data backed up.

  1. Open the Command Prompt in Windows or Terminal on a Mac and navigate to the folder that ADB and Fastboot are installed in. Again, if you installed the full SDK, it’s in the C:program files (x86)androidandroid-sdkplatform-tools folder. Just type cdprogram files (x86)androidandroid-sdkplatform-tools at the prompt in Windows. If ADB and Fastboot are somewhere else, just navigate to it. To make things easier so you don’t have to type out long directories, you can also paste it by pressing ALT and the Space Bar, then choose Edit, followed by Paste.

If you’re using a Mac, you need to add the platform tools directory to your $PATH. In terminal, type sudo nano/etc/paths. Now enter your password and go to the bottom of the file and enter the full path of the “platform tools” directory. Hit control-x to quit and enter Y to save.

The following ADB commands are for Windows machines. If you’re using a Mac, just add ./ before each command, for example: ./adb reboot bootloader.

  1. Assuming you device is already connected to your computer via USB and USB Debugging is enabled, you need to re-start it in fastboot mode. Follow one of the two methods below. Option A may be preferable as it will know right away if your computer doesn’t recognize your Nexus device.

A) Type adb reboot bootloader

B) Turn your device off, then turn it back on while holding down the relevant key combinations for your device. For many devices it’s Volume Up + Volume Down + Power. You can see what your device’s key combinations are here.

  1. Type fastboot oem unlock to unlock you device. As a final warning, this step will erase everything on your device.
  2. Type flash-all to install the bootloader, baseband firmware(s), and operating system. If you get a missing system.img error, then scroll down to bottom of this page for further instructions.
  3. This process could take several minutes so it’s important not to power off or disconnect the device. Once it’s finished, your device will reboot and the Android M Developer Preview will be installed.
  4. You can opt to re-lock the bootloader if you wish, but assuming you will do this again with a future update, you might want to leave it unlocked so you don’t have to perform a factory reset again. If you do want to re-lock, just follow Step 2 above and change Step 3 to fastboot oem lock. That’s it.

If your device already has an unlocked bootloader and you don’t want to do a factory reset and lose your data, follow the instructions below.

  1. Open the Command Prompt in Windows and navigate to the folder that ADB and Fastboot are installed in. Again, if you installed the full SDK, it’s in the C:program files (x86)androidandroid-sdkplatform-tools folder. Just type cdprogram files (x86)androidandroid-sdkplatform-tools. If it’s somewhere else, just navigate to it. To make things easier so you don’t have to type out long directories, you can also paste it by pressing ALT and the Space Bar, then choose Edit, followed by Paste.

If you’re using a Mac, you need to add the platform tools directory to your $PATH. In terminal, type sudo nano/etc/paths. Now enter your password and go to the bottom of the file and enter the full path of the “platform tools” directory. Hit control-x to quit and enter Y to save.

Note: The following ADB commands are for Windows machines. If using a Mac, just add ./ before each command, for example: ./adb reboot bootloader

  1. Assuming the device is already connected to your computer via USB and USB Debugging is enabled, you need to start it in fastboot mode. Follow one of the two methods below.

A) Type adb reboot bootloader

B) Turn your device off, then turn it back on while holding down the relevant key combinations for your device. For many devices it’s Volume Up + Volume Down + Power. You can see what your device’s key combinations are here.

  1. You will need to edit the flash-all.bat file that you extracted from the factory image, which should be in the same directory as ADB and Fastboot. Just open it with any simple text editor such as WordPad. You will see a line that starts with “fastboot -w update……..” Just remove the -w from this line. The -w flag wipes your data, so removing it will obviously stop that from happening.
  2. Type flash-all to install the bootloader, baseband firmware(s), and operating system. If you get a missing system.img error, then scroll down to bottom of this page for further instructions.
  3. This process could take several minutes so it’s important not to power off or disconnect the device. Once it’s finished, your device will reboot and the Android M Developer Preview will be installed.

If you get a missing system.img error in Step 4 of either method, then follow these instructions

Extract all the files from the .zip file which happens to be one of the files extracted from the original .tgz you downloaded from Google. The Zip file name probably begins with “image.” There should be various .img files within this Zip file. On top of this, you already have bootloader and radio .img files in the same directory. Just make sure all the .img files (from Zip file) and the ones that were already extracted are in the same directory as ADB and fastboot. Now you are going to flash each .img file separately.

If you don’t have either one of the bootloader or radio .img files, don’t worry, not all devices need them. It’s also important to follow this exact order. At the CMD prompt and in the C:program files (x86)androidandroid-sdkplatform-tools directory (if you installed the full SDK) or wherever ADB and fastboot reside. Remember, add ./ before each command if you’re using a Mac.

  1. type fastboot flash bootloader [name of your file].img
  2. type fastboot flash radio [name of your file].img
  3. type fastboot reboot-bootloader
  4. type fastboot flash recovery recovery.img
  5. type fastboot flash boot boot.img
  6. type fastboot flash system system.img

If your device is a Nexus 9, then also issue this command – fastboot flash vendor vendor.img

Lastly, if you want, you can wipe the cache with this command – fastboot flash cache cache.img

That’s it, enjoy the newly installed Android M Developer Preview.

USB connectivity issues

If your computer doesn’t recognize your device via USB, you do not have the appropriate drivers installed. Make sure that you installed the Google USB Drivers found here, and if you still have an issue, follow these steps.

  1. On your Windows desktop, Go to your Control Panel then Device Manager.
  2. You should see Android Phone under Other Devices with a Yellow ! mark on it.
  3. Right click on it and choose update driver
  4. Choose browse my computer, then Let me pick from a list.
  5. Select Android ADB Interface.
Robert Nazarian
Former Digital Trends Contributor
Robert Nazarian became a technology enthusiast when his parents bought him a Radio Shack TRS-80 Color. Now his biggest…
Everything you need to know about the OnePlus 13
Official OnePlus 13 product renders showing rear panel colors.

OnePlus is an excellent brand that offers powerful flagship phones at a great value compared to some of its competitors. We followed every rumor about the OnePlus 13 for months, but now it's here — and it's everything we hoped for. It might not be available in the Western market yet, but it will be soon.

So, what makes the OnePlus 13 so special? Here's everything you need to know about OnePlus' latest flagship.
When is the OnePlus 13 being released?

Read more
Qualcomm Snapdragon 8 Elite vs. MediaTek Dimensity 9400: the race is on
Comparison of Qualcomm Snapdragon 8 Elite and MediaTek Dimensity 9400 processors.

The flagship mobile silicon race has entered its next phase, one that will dictate the trajectory of Android hardware heading into 2025. Merely weeks after MediaTek wowed us with the Dimensity 9400 system on a chip (SoC), Qualcomm also pulled a surprise with the reveal of the Snapdragon 8 Elite.

But this time around, the battle is not as straightforward. Where MediaTek is working closely with Arm and adopting its latest CPU and graphics innovations, Qualcomm has firmly put its faith in custom cores. These are no ordinary cores, but a next-gen iteration of the same fundamental tech stack that powers Windows on ARM laptops.

Read more
Discolored line on your new Kindle? You aren’t alone
Amazon Kindle Colorsoft Signature Edition on a table.

The new Kindle Colorsoft Signature Edition is the first full-color e-reader, and a lot of bookworms couldn't wait to get their hands on it. Sadly, many people are reporting the display has a discolored yellow area at the bottom of the screen. The problem is so widespread that the Kindle Colorsoft dropped to an average review rating of 2.6 out of 5, although it does remain the bestselling e-book reader at the moment.

The cause of the discoloration isn't clear. Some users report that it only happens when using the edge lighting feature on the Kindle, while others say it appeared after a software update. Either way, the yellowing is a problem, especially on a device that Amazon has marketed as being great for comics and graphic novel fans. It's hard to enjoy the colorwork in a comic when it's distorted.

Read more