Wednesday, September 6, 2017

Flashing the Android N Developer Preview on a Nexus 9

Flashing the Android N Developer Preview on a Nexus 9


Following my battery and application tests on my new Nexus 9, it was time to test the Developer Preview build on Android N.


Enrolling in the Beta programme

The standard way to get the N preview on your Nexus device (Nexus 9, 5X, 6, 6P, Nexus Player and Pixel C) is to enrol in the Android Beta programme, which you can sign up for at this URL:

https://www.google.com/android/beta

Once logged in you can enrol or unenrol your compatible Nexus devices into the Beta channel and you will receive OTA updates, starting with the current N build being applied over your existing Marshmallow build.

Sadly for the Nexus 9, OTA support was dropped due to various issues applying the firmware on devices. However, the factory images are still available for those that still want to try it.

Downloading the Factory Images

The released factory images are located here:

https://developers.google.com/android/nexus/images

Preview build factory images are located here:

http://developer.android.com/preview/download.html

Once downloaded, unpack the tgz image so you can see the individual files, including the flash-all.bat

Preparation

As always when installing factory images on Nexus devices, you need to do a little preparation:

1. Ensure you have installed adb and fastboot onto your machine. For Windows, the easiest way is likely to download and install the latest ADB Installer from XDA.

2. Ensure your device is in Developer mode (by repeatedly clicking on the Build number in Settings / About) and then enable USB Debugging inside Developer options.

3. Unlock the bootloader of your device.

To unlock the bootloader you need to attach a USB cable to the device while it is on, reboot into the bootloader and then perform an unlock:

adb reboot bootloader
fastboot oem unlock

Once the bootloader is unlocked, you can flash whatever you like onto the device.

Flashing the image

When in the bootloader, in theory all you need to do is to execute the batch file contained within the firmware archive:

flash-all.bat

The process should be automatic from this point.

Issues on my Nexus 9

When I executed the batch file, the bootloader was reflashed, but I got an error message:

Error: Update Package Missing System.img

The batch file executes the following commands:

fastboot flash bootloader bootloader-flounder-3.48.0.0136.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update image-volantis-npc56p.zip

It was the last command that caused me issues - updating via the zip file.

Rather than updating in this manner, I had to extract the zip file, which contained the following firmware images:

boot.img
cache.img
recovery.img
system.img
vendor.img

The issue was resolved by simply flashing each of the images manually:

fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash vendor vendor.img

To finish I rebooted the device:

fastboot reboot

So all in all it was a bit more fiddly than anticipated. I guess this is why it is a developer preview and possibly why the Nexus 9 image was removed from OTA!


download file now