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

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

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

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

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…
I record interviews for work. These are my favorite free recorder apps
The iPhone 14 Pro and Google Pixel 7 Pro's voice recording apps running together.

The Voice Recorder app on a phone (left) and the Voice Memos on another phone Andy Boxall / Digital Trends

Before you head to the app store on your phone to buy a voice-recording app, take a moment to consider the apps that may already be installed on your phone. Why? In my experience, they're likely all you really need. I’ve recorded interviews and voice-overs for work for years, and I’ve found the two best examples come preinstalled on your phone already, so they’re entirely free to use.

Read more
The best Samsung Galaxy Z Fold 5 cases: 10 best ones so far
Two Galaxy Z Fold 5 phones next to each other -- one is open and one is closed.

Samsung’s next-generation foldable is here with the Samsung Galaxy Z Fold 5. This iteration has some notable improvements, including a new hinge design that eliminates the gap from previous generations when the device was folded. You also get a 6.2-inch HD+ Dynamic AMOLED 2X display on the outside while having a 6.7-inch QXGA+ Dynamic AMOLED 2X display on the inside, with both screens having a 120Hz refresh rate. In other words, they're about as nice as you could ask for.

The Galaxy Z Fold 5 is made with premium materials, and the triple-lens camera system packs in a 50MP main shooter, 10MP telephoto with 3x optical zoom, and a 12MP ultrawide lens. There’s a 10MP selfie camera on the front cover, and a 4MP camera on the inner display. You also get a Snapdragon 8 Gen 2 for Galaxy chip inside for the best performance and power efficiency.

Read more
Google Pixel Tablet just got its first big discount and it’s worth a look
Google Pixel Tablet on its charging dock.

Tablets are a dime-a-dozen these days, with offerings from all the great brands including Apple, Samsung, Lenovo, and more. So, if you really want to stand out in a sea of similar tech, you need to do things a little differently. That's what Google's Pixel Tablet offers. How? It comes with a unique speaker dock that can be used to both charge the device and offer room-filling sound -- almost like a smart speaker add-on. Better yet, when your Pixel Tablet is docked it benefits from the Hub Mode, turning the device into a smart display, with digital photo frame support, smart home controls, and hands-free Google functionality. Of course, it could set you back at full price, normally $499 unless you find it included in a roundup of the best Google Pixel deals. Well, guess what? Thanks to a Best Buy Google Pixel Tablet deal, you can get it today for $439 and save $60. Hurry, though, it's part of Best Buy's recent 48-hour sale so it won't stick around for long.

Why you should buy the Google Pixel Tablet
Okay, okay, so in our Google Pixel Tablet review, Joe Maring did give it less than stellar remarks, but he called out its reliable fingerprint sensor, comfortability during use and excellent speaker dock. Honestly, how many tablets come with a matching speaker dock that transforms the entire experience? This tablet also marks a "lot of firsts" for Google, as it's the first tablet from the company in nearly five years, the first Android tablet in eight years, and can be converted into a smart home display with the speaker dock. All of which are notable milestones.

Read more