Google Nexus smartphones are popular for their bloatware free interface and quick OS updates from Google. It’s customary that the first Android update would hit a Nexus device before reaching the other OEM devices. The OTA updates from Google might get a little delayed depending on the region but they always provide the Nexus Factory Images for direct flashing on the Nexus devices. We know that this can be a little scary for beginners, that’s why we have made this comprehensive guide to help everyone flash Nexus Factory Images on their Nexus devices.
Factory images are a bit different from the OTA updates as they contain the complete system files while the OTA package usually comes in incremental update packages. So, using OTA doesn’t require to format the device, it simply updates your device keeping all the files intact. On the other hand, flashing the Nexus factory images will wipe the entire device and does a clean install of the software. OTA updates are preferable for minor OS updates but when you’re going for a version upgrade, better opt for the factory images as you’ll get a clean start.
Many users asked me what’s the bright side of wiping the entire device while they can simply update using OTA. Well, it’s a matter of choice but I always prefer a clean install as I don’t have to deal with the annoying bugs and lags which usually pop out after the OTA updates. Moreover, it’s a bit difficult to find the OTA mirror files while the Nexus factory images are directly uploaded by Google on their Developer’s site.
So, if you’ve chosen to use the Nexus factory images, let’s begin with our detailed tutorial.
Unlocking bootloader and flashing Nexus factory images will wipe your entire device. So, make sure you have taken necessary backups before you begin with the tutorial. Be careful while choosing the correct factory images for your Nexus device or you’ll end up with a bricked device. You alone are responsible for the consequences, we won’t be liable if any damage occurs to your device even though we’re confident that the process works and is tested by many users. However, you can reach us for assistance in the comments section.
- Charge your device above 60% to make sure it doesn’t die in the middle of the process which may be fatal sometimes.
- Make a backup of everything on your device so that you can restore the files if something goes wrong. Here’s the usual checklist:
- Install proper drivers on your PC. If you haven’t installed them already, you can follow our detailed USB driver installation guide.
- Setup ADB and Fastboot files on your PC. If you don’t know how, follow our detailed guide on how to setup ADB and Fastboot on your PC.
- Prepare your device:
- Enable developer options: Go to your device’s Settings » About phone » Scroll to the bottom and tap on “Build number” seven times to enable developer options.
- Enable USB Debugging: Go to your device’s Settings » Developer options » tick the “USB debugging” checkbox (sometimes listed as Android Debugging)
- Enable OEM Unlock: Go to your device’s Settings » Developer options » tick the “OEM Unlock” checkbox.
- Download the Nexus factory images from the Google Developers page.
Step-By-Step Installation Guide
In this guide, first we will unlock the bootloader on your Nexus device and then flash the factory images. So, without any ado, let’s start with the guide.
Phase 1: Unlock the Bootloader
Unlocking the bootloader on the Nexus device would wipe the entire device, so it’s important that you take a thorough backup of your device before proceeding with this guide.
- Connect your Nexus device to the PC using a USB cable and make sure it’s detected. If not, make sure that you’ve installed proper USB drivers and enabled USB debugging.
- Once detected, tap on the USB icon in the notifications panel and select MTP file transfer mode.
- Open the command prompt in the PC and type the below command:
- To confirm that your device is recognized by ADB, a message will appear “List of devices attached” along with your device serial number.
- Once you find your device’s serial number appearing in the message then type the below command in the command prompt to reboot into fastboot mode.
adb reboot bootloader
- Now, type the below command to unlock the bootloader on Nexus 6P (may be the future devices as well).
fastboot flashing unlock
For devices older than Nexus 6P (Nexus 5X as well), use the below command to unlock the bootloader.
fastboot oem unlock
- You’ll get a confirmation screen on your phone to erase the data on the device.
That’s it. You’ve successfully unlocked the bootloader on your device. Reboot the device once just to make sure everything’s OK.
Phase 2: Flashing Nexus Factory Images (One-Click Method)
All the Nexus firmware come with a batch file/shell script file for one-click installation. So, here’s how to flash it using the one-click installation method.
- Download the Nexus factory images for your device from the download section and extract it to your PC.
- Navigate to the folder where you have extracted these files, and you’ll find the files similar to the below screenshot.
- Connect your device to the computer and type the below command in the command prompt to reboot into fastboot mode.
adb reboot bootloader
- When in fastboot mode, run the flash-all.bat (Windows) or flash-all.sh (Mac and Linux). A command window will launch and you’ll see the on-screen progress.
- Just follow the on-screen instructions and the firmware will be flashed to your Nexus device.
In some cases, users have reported that they are receiving “error: update package missing system.img” while flashing the Nexus factory images using the one-click scripts. In that case, follow the manual installation method to flash the Nexus factory images on your device.
Phase 3: Flashing Nexus Factory Images (Manual Method)
- The Nexus factory images will come in a .tar package. Change its extension to .tgz and extract it on your PC and you’ll get a bunch of files along with a zip file with the name image-xxx-xxx.zip.
- Extract the zip file on your PC and you’ll get the files similar to below list.
- Rename the bootloader and radio images files to bootloader.img and radio.img just for our convenience.
- Navigate to the path where you’ve placed the image files and open a command prompt in that folder by pressing Shift +Right click in any empty space inside the folder, and select Open command window here from the Windows context menu.
- Connect your Nexus device to the PC using an USB cable and make sure it’s detected by giving the “adb devices” command.
- If everything OK, reboot your device into bootloader mode by executing the following command in the command prompt:
adb reboot bootloader
- Once you’re in fastboot mode, you need to manually flash the .img files using the fastboot commands.
- Now, flash the bootloader that came with the factory image followed by the radio.img using the below commands. (radio.img is not found in all factory images, so don’t worry if you can’t find it in your Nexus factory image)
fastboot flash bootloader bootloader.img
fastboot flash radio radio.img
Note: Make sure that the image file you’re flashing has the same name as in the folder. If the image name is different like bootloader-hammerhead-xxxxx.img, rename it to bootloader.img or change the command as per the file name.
- It’s important that you reboot the bootloader once you flashed the new bootloader and radio images. Don’t skip this step.
- Once the device boots into new bootloader, flash the rest of the images one-by-one using the following commands:
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
- If you want to do a full wipe of the device, use the following commands one-by-one:
fastboot flash cache cache.img
fastboot flash userdata userdata.img
- The Nexus 9 factory image comes with an additional image file with the name vendor.img which contains the drivers. Flash it with the below command if you own a Nexus 9.
fastboot flash vendor vendor.img
- Once everything is flashed, reboot the device with the following command:
The first boot will take a while as the system needs to build the cache, so be patient and grab a cup of coffee while your device is booting up.
That’s all! Reach us in the comments section below for any queries or assistance regarding the process in the tutorial. Also, do suggest any modifications or additions to this comprehensive guide, your feedback is important to improve our content and services.
If you find our tutorial useful, kindly share this tutorial with others using the share buttons below. Remember, Sharing is Caring!