Upgrade or Restore

How to install new version of Android using factory image on a Nexus device

When you want to upgrade, or restore your Nexus device to its original state, use this guide to manually install Android using a factory image.

Installing Android using factory image

Google is known for always upgrading its Nexus phones and tablets with a new version of Android before any other device. However, the roll out of a new update can take weeks or months to reach everyone — even with Nexus devices.

It takes a significant amount of time because updates always release on stages to allow the company to halt the rollout, so if something happens only a small number of users get affected.

Fortunately, Google allow tech-savvy users to install a new version of Android manually using the official factory image for supported devices. This means that you don’t have to wait weeks to upgrade your phone or tablet.

Additionally, you can use this process to restore (reinstall) the original factory firmware, when your phone or tablet is not working properly, or you installed a custom version of Android, and you want to go back to the factory defaults.

In this guide, you’ll learn the steps to install the latest (or original) version of Android using an official factory image on Windows 10.

Download and install these components before beginning

Important: Upgrading or restoring your device using a factory image will erase everything on your device, as such make sure to make a backup of your information and data before proceeding.

How to flash a Nexus device using official factory image

To flash your Nexus device with a factory image to upgrade the operating system, do the following:

  1. Use 7Zip to extract the android-sdk-windows folder with the Android SDK files.

    Extract Android SDK Windows folder

  2. Inside the android-sdk-windows folder, double-click the file to launch the SDK Manager.

  3. On the SDK Manager uncheck everything except “Android SDK Platform-tools”. If you’re using a Nexus device, you can also select “Google USB Driver”.

    Android SDK Manager

  4. Once you completed the installation, close the SDK Manager.

  5. Depending on your Nexus device (e.g., HTC or Motorola), you may need to download the USB drivers from your manufacturer’s support website.  

  6. Download the latest factory image (e.g., Nougat or Marshmellow) for your Nexus device, including Nexus 6P, Nexus 5X, Nexus 6, Nexus 7, Nexus 9, or Pixel C.

    Note: Avoid using Microsoft Edge, as it may download a “.tar” file instead of the original “.tgz” file compression extension. Use Google Chrome instead.
  7. Open the “.tgz” file containing the factory image files with 7Zip, and extract the files one-by-one to avoid errors during extraction to the platform-tools folder inside the android-sdk-windows main folder.

  8. Open Settings on your phone or tablet.

  9. Select Developer options.

  10. Turn on the USB debugging toggle switch.

    Android enable USB debugging

  11. Connect your device to your Windows 10 computer using a USB data cable.

  12. Inside the platform-tools folder, press and hold the Shift key and right-click and select Open command window here.

    Open command window here

  13. Type the following command to reboot your device into the bootloader:

    adb reboot bootloader

    Android adb reboot bootloader command

  14. If your device is locked, you can unlock the device’s bootloader using the following command:

    fastboot flashing unlock

    On older devices, you may need to run the following command:

    fastboot oem unlock

    The device will show you a confirmation screen.

  15. Inside the platform-tools folder, press and hold the Shift key and right-click and select Open command window here.

  16. Type flash-all.bat and press Enter. Or simply double-click the flash-all.bat file. This script will install the bootloader, baseband firmware, a clean version of the operating system wiping out your system.

    Android flash-all.bat file to upgrade phone or tablet

  17. If your device was locked and you unlocked it, make sure to re-lock the device using the following command:

    fastboot flashing lock

    On older devices, you may need to run the following command:

    fastboot oem lock

Once you completed the steps mentioned above, you’ll need to reinstall your apps and restore your data from backup.

Wrapping things up

Google calls this installation process “flashing”, and it’s useful in a number of scenarios. Using the a factory image can help you to manually upgrade your Nexus phone or tablet to the latest version of Android without having to wait weeks or months.

It’s useful to do a clean installation of the operating system, when things are not working correctly, or when you’re ready to sell or give away your device without compromising your data. Or you can use this process to flash your Nexus device and restore the original version of the operating system, which may not be the latest, but it works for you.

Did you have any issues installing Android using a factory image? Tell us in the comments below.

Was this helpful? Support the long hours of work.