The Android M Developer Preview is out and you can download and install it if you have a Nexus 6, Nexus 5, Nexus 9, or the Nexus Player. A lot of people asked me how to install it, and I’m here to tell you guys how you can easily install it on to your device.
Before we begin,
Backup the data in your device as everything will be lost.
Make sure USB Debugging is enabled under Developer Options.
Make sure your device is charged.
Make sure you have the Android SDK installed on your device.
If the Bootloader on your device is locked, First unlock it.
You can download the firmware from here or get it from the direct links given below.