How to install Android M Developer Preview (Nexus 5, 6, 9 required)
So how do you do it?
Android M Developer Preview requires you have ADB tools
Luckily, the process is very simple and straightforward, especially to those who have tried flashing a custom ROM before, but even to newbies, it will all work out easily if you follow the simple steps below. As with anything new, we recommend you don't rush to install it - the process itself takes a few minutes, but downloaded the Android M Developer Image and all the required tools (if you don't have them) takes time, so you might want to get a window of around one hour so that you can do it all calmly and even have some time to play around with Android M once you've installed.source: Google Developer
Things that are NOT allowed: