Fastboot mode on a Nexus 5.
Take a look at your phone’s screen: If it says “locked state: locked,” you may need to unlock the phone’s bootloader first. Run the command
fastboot oem unlock, then confirm on your phone that you want to unlock the bootloader. Note that doing so will erase all data on your phone, so be absolutely sure that this is necessary before you run this command.
Installing Android Marshmallow
Now that your bootloader is unlocked, it’s time to install the Marshmallow image on your phone. Type
flash-all.bat (on Windows) or
flash-all.sh (on OS X) to run the installation script, then press enter.
(Note: If running the script results in a string of
command not found messages on OS X, you’ll actually have to open the script in a text editor—TextEdit works—then add “./” in front of all instances of “flash-all.sh” in the script, just as you did with terminal commands you entered. Save your changes then quit your text editor, and then try again.)
The flashing process takes some time, so be patient: Your phone will restart when the flashing process is complete. If all goes right, your phone will spring back to life with Android M installed. It may take your phone a while to boot back up the first time you restart, so don’t panic if your phone is stuck on the boot screen for several minutes.
Success! Say hello to the Android Marshmallow lock screen.
If you unlocked your bootloader, you may want to lock your bootloader again for security reasons, so reenable developer options and USB debugging, then boot into fastboot mode using the
adb reboot bootloader command, then run the
fastboot oem lock command: Depending on your device, you may lose your data again. Press your power button to restart your phone one last time.
You’re all finished. Go and have fun exploring Android Marshmallow!
Sign up for CIO Asia eNewsletters.