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…
Google’s first Android 11 developer preview brings permissions tweaks and more
features refinements android 11 wishlist 10 q hands on 2

Android 11's path to release has finally begun. Google announced the first developer preview for Android 11, and it's now available for developers who want to start building apps and services for the next version of Android.

It's important to note that the majority of consumer-facing features in Android 11 won't be announced until Google I/O 2020 in May. Instead, this first developer preview serves as a way to introduce developers to new APIs -- like new APIs around 5G and permissions.

Read more
5 phones you should buy instead of the iPhone 16 Pro
Someone holding the iPhone 16 Pro.

If you’re in the market for a new phone, whether it’s for yourself or a loved one, you may be considering the iPhone 16 Pro from Apple. After all, it just came out, and it’s packed with the latest and greatest from the fruit company. That means an A18 Pro chip for fast performance, an upgraded 5x telephoto camera, the new Camera Control button, Apple Intelligence features in iOS 18, and more.

But what if we told you there are some better options out there? And some offer even better features or are a better value? Here are five alternatives to consider before you buy the iPhone 16 Pro.
iPhone 16

Read more
I used Oura’s and Samsung’s latest smart rings. This one is my favorite
Oura RIng 4 and Galaxy Ring in the hand.

Smart rings have fast become one of the hottest markets in the wearable technology market. For many years, Oura was the leader and the only real maker of smart rings that appealed to most people. Then came a myriad of other options, including rings from RingConn, Ultrahuman, Circular, and, most importantly, Samsung’s first smart ring.

The Samsung Galaxy Ring takes a different approach to the competition. Built around the Samsung Health ecosystem, it is designed to be a companion to the Galaxy Watch lineup. It has a much simpler set of features than other smart rings, which focus on packing as much technology into the ring as possible.

Read more