Google released the Android N Developer Preview today, surprising just about everyone. Considering we all expected the developer preview to land at Google I/O as it has in the last two years. Now that Android N is actually available, albeit in extremely beta - maybe even alpha - stage. Many are going to want to install it on their Nexus 5X, Nexus 6, Nexus 6P, Nexus 9, Nexus Player or Pixel C. Luckily you can do so. And below, we have the instructions on how to do so.
Before we get started, there are a few things you'll need. Number one is the Android SDK. You'll need to have that downloaded and installed before we get started here. You'll also need to download the factory image. Which is just over a gigabyte, so you'll want to download that before we get started. Now you'll want to make sure that your bootloader is indeed unlocked. To check, simply go into Settings > Developer Settings and check to be sure "Enable OEM Unlock" is checked. Next up you'll want to plug your phone or tablet into your computer. Now open a command prompt window and run "adb devices". This checks to be sure the device is connected to your computer. You will get a pop up on your phone asking if you want to allow access to that computer. Just tap "Yes" and then you're all set. Now, you'll type in the command "adb reboot bootloader". This takes you into the bootloader mode, and you'll see some information on the screen. If it says the device is locked, then you'll need to unlock it. Type into the command prompt "fastboot flash unlock", then press the power button on your phone to confirm. And you're unlocked.
Now that the factory image is downloaded, you'll want to extract it. Now if you have the Android SDK installed, you can use the flash-all.bat script and automatically flash everything. If you just have the minimal ADB and Fastboot installed, then you'll need to flash everything individually. In the command prompt window, cd or change directory, to the directory that the factory image is housed. Now type in "flash-all.bat" without the quotes of course. It should begin flashing everything which will take a few minutes.
Those that rather do it the old fashioned way, or don't have the Android SDK installed, you'll need to follow the following commands:
fastboot flash bootloader [bootloader-name].img
fastboot flash radio [radio-name].img
fastboot reboot bootloader
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash vendor vendor.img
Now that everything is installed, it's a good idea to completely wipe your phone. Including the cache. Especially since developer previews are typically pretty buggy and having leftover data can cause unnecessary issues. Use the following commands to clear all data and then reboot:
fastboot flash cache cache.img
fastboot flash userdata userdata.img
When installing a brand new operating system, it's typical for the first boot to take quite a while. Especially after clearing the cache and userdata. As it needs to rebuild all of that data on the device. We'd recommend waiting about 10 minutes before worrying about being stuck in a boot loop or some other issue. But once it's booted up, you'll be in the Android N Developer Preview.
If you get stuck in a bootloop, here are a few things you can try.
Pressing Power + Volume Down for about 25-30 seconds until the phone turns off then jumps into Bootloader mode. Use the volume buttons to highlight Recovery and then Power to select. You'll see a droid on the screen with a red triangle. Press Power + Volume Down again and you'll get into Recovery Mode. Now wipe the cache partition. Then do a factory reset. Once you do that, you should be able to reboot the phone and be good to go.