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.

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.

Editors' Recommendations

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…
Android 10 is here, but how many devices did Android 9.0 Pie reach?
android 9 pie app switcher

Android 10 has been released, but as it's still early, only a few devices have been updated to Android's latest version. As such, it will be a while before Google releases numbers about Android 10's penetration into the market. But we can still take a look at how well Android's last major update, Android 9.0 Pie, has been doing. According to numbers from May of 2019, Google is still struggling to update existing devices to its latest operating systems, with the adoption of Pie at a measly 10.4%.

As was true back in October 2018, Android Oreo is still the most common version of Android on devices, with versions 8.0 and 8.1 amounting to a combined 28.3% of all active Android devices. That's a massive 9.1% increase since October 2018. Android Nougat comes in second place, with 7.0 and 7.1 representing 19.2% of all active Android devices. In fact, if placed into a hierarchical list, Android 9.0 Pie comes in at an embarrassing fifth place, behind 2014's Android Lollipop (14.5%) and 2015's Android Marshmallow (16.9%).

Read more
Android 15 might add a new way to charge your gadgets
The Android 15 logo on a smartphone.

Wireless charging has been a fringe feature for over a decade, despite Apple's push into the ecosystem with the iPhone X and its later adoption of MagSafe. It has been limited to flagship phones, save for a few exceptions, mostly due to the painfully slow charging speeds. But with Android 15, Google now seems to offer phone makers additional reasons to adopt wireless charging even without dedicated hardware.

Instead of relying on a dedicated charging coil, Android 15 could enable wireless charging on phones with Near Field Communications (or NFC) tech. Android Authority dug up instances from the source code of Android 15's first user beta, which arrived last week, that suggests the implementation.
Not new, but definitely noteworthy
Samsung Galaxy S23 FE Tushar Mehta / Digital Trends

Read more
How futuristic display tech is trying to save your eyes
Lock screen on Onyx Boox Tab Ultra C

I recently found myself on a reporting assignment in Trivandrum, a beautiful beach town in India’s southernmost state. One sweltering day, as I lay reading some comics on a deckchair, I noticed that a Dutch woman kept taking a peek at my tablet. With hopes of finding a new comics-loving friend from a different world, I asked if she enjoys the work of Mark Millar.

“I am more curious about the screen protector on your tablet. What is it?” she asked in her distinctive accent. I told her that there was no screen protector in place. The display itself looks and feels like paper, with little to no glare. The slate in question was the Onyx Tab Ultra C, which features a Kaleido 3 E Ink display.

Read more