The following trick will teach you how to install Android M on your Nexus device. The new Android operating system is currently available for the following devices Google Nexus 5, Google Nexus 6, Google Nexus 9, and Google Nexus Player.
Before starting the process it is highly recommended to create a full back up of your android smartphone, then follow the following steps.
Step 1
You will need to download and install the latest Android Studio Preview on your Windows computer. This installs the ADB and Fastboot programmes, which can be accessed through the command terminal on your PC.
Step 2
Add the SDK folder to the PATH by following these steps:
Step 3
Right click My Computer and click on Properties.
Step 4
Click on Advanced System Settings.
Step 5
Click on System Properties > Advanced > Environment Variables.
Step 6
In the Window, select Path, then click on Edit, and then type in the name of the directory where you installed the SDK, and remember that each entry is separated by a semi-colon.
Step 7
Enable USB debugging on your device. First, go to Settings > About Phone > Software information.
Step 8
Tap Build number seven times.
Step 9
Go to Settings > Developer options. Tick USB debugging.
Step 10
Download the correct factory image for your device.
ie: for Android M for Nexus 5 or for Nexus 6 for Nexus 9
Step 11
Extract the image on your computer.
Step 12
Connect your device to your computer over USB.
Step 13
Start the device in fastboot mode.