Here's how to manually download Android M preview and install it on your Google Nexus devices.
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.
Add the SDK folder to the PATH by following these steps:
Right click My Computer and click on Properties.
Click on Advanced System Settings.
Click on System Properties > Advanced > Environment Variables.
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.
Enable USB debugging on your device. First, go to Settings > About Phone > Software information.
Tap Build number seven times.
Go to Settings > Developer options. Tick USB debugging.
Download the correct factory image for your device.
Android M for Nexus 5
Android M for Nexus 6
Android M for Nexus 9
Android M for Nexus Player
Extract the image on your computer.
Connect your device to your computer over USB.
Start the device in fastboot mode.
The easiest way to do this is to hold a key combination while powering up the device. For Nexus 5, hold the volume up, volume down and power buttons while powering on the device. The full list of key combinations for different devices is here.
You can also boot into fastboot mode using the ADB tool: With the device powered on, go to the command terminal and execute the following: adb reboot bootloader
If needed, unlock the device's bootloader through your computer using the command terminal and executing: fastboot oem unlock
Open a command terminal and navigate to the unzipped system image directory.
Execute flash-all.bat, which was a part of the unzipped image file. This script installs the necessary bootloader, baseband firmware(s), and operating system. For this to work, you need to have added the folder where ADB and Fastboot are installed to the system's path as described in step 2.
When this is done, Google recommends that you lock the bootloader for security. You can do that by booting the device in fastboot mode while still connected via USB, and using the command terminal to execute: fastboot oem lock.
That will install Android M preview on your Nexus device. Android M will receive monthly OTA updates until the final version ships, according to a report, so you won't have to repeat this complicated process again. We still recommend that you just wait a while until the OTA update arrives on your device, unless you want to stay on the bleeding edge of smartphone OS development.