How To Install Nexus 5 Factory Content
Restoring official factory images to your Google Nexus 5 requires unlocking the device bootloader, utilizing Google-provided platform tools, and executing precise terminal flash commands to completely wipe and rebuild system partitions. This comprehensive guide details the exact procedure to revive your hardware, clear persistent software loops, and return the device to its pristine, out-of-the-box software state.
Pre-Operation & Equipment Checklist
Restoring the factory image on a legacy device like the Nexus 5 demands absolute precision, stable hardware connections, and proper software environments. Because flashing low-level firmware partitions can permanently brick a device if interrupted, establishing a controlled workspace is paramount.
- Essential Hardware:
- Google Nexus 5 smartphone (hammerhead model).
- Original or high-quality certified USB-A to Micro-USB data cable (avoid charge-only cables).
- A host computer running a stable operating system (Windows 10/11, macOS, or Linux).
- Unbroken access to a stable power source for the host computer to prevent mid-flash power cuts.
- Mandatory Software & Prerequisites:
- Official Android SDK Platform-Tools package containing the
fastbootandadbbinaries. - The correct official Google factory image zip archive specific to the Nexus 5 (build number matching your carrier or the final global release, typically M4B30Z or earlier Android 6.0.1 builds).
- Basic familiarity with command-line interfaces (Terminal on macOS/Linux or Command Prompt/PowerShell on Windows).
- Official Android SDK Platform-Tools package containing the
- Time and Risk Benchmarks:
- Estimated duration: 30 to 45 minutes for first-time operators.
- Risk factor: Moderate-High (involves complete user data erasure and bootloader manipulation).
Step-by-Step Firmware Restoration Workflow
Step 1: Environment Setup and Driver Verification
Download the official Android SDK Platform-Tools archive from Google and extract the contents to an easily accessible directory on your computer, such as C:\platform-tools on Windows or /Users/username/platform-tools on macOS. Download the official Nexus 5 factory image .tgz file and extract its contents directly into this same platform-tools folder. Ensure you extract the inner nested zip file so that files like bootloader-hammerhead-*.img, radio-hammerhead-*.img, and the primary image zip (containing system.img, boot.img, recovery.img, and cache.img) all reside alongside the fastboot binary. For Windows users, install the official Google USB Drivers and verify via Device Manager that the device registers correctly as an Android Bootloader Interface when connected in fastboot mode.
Warning: Flashing factory content completely wipes all user data, internal storage, installed applications, and personalized settings. Ensure all critical data is backed up externally before proceeding with partition writes.
Step 2: Bootloader Unlocking and Device Preparation
Power down your Nexus 5 completely. Boot the device into Fastboot Mode by pressing and holding the Volume Down and Power buttons simultaneously until the green Android robot and "Start" graphic appear on the screen. Connect the device to your computer via the Micro-USB cable. Open your command-line interface, navigate to your platform-tools directory using the cd command, and type fastboot devices to verify communication. If your device serial number appears alongside the word "fastboot," the connection is active. If the bootloader is currently locked, unlock it by executing the command fastboot oem unlock.
Pro-Tip: If the command line returns a "waiting for device" status, your computer lacks the proper USB drivers or the cable is functioning strictly as a power delivery conduit rather than a data sync line. Swap ports or cables immediately.
Step 3: Executing the Factory Flash Sequence
With the device recognized in fastboot mode and unlocked, you can initiate the flashing sequence. If you are using Windows, locate the flash-all.bat script inside your platform-tools directory and execute it by typing flash-all in the command prompt. For macOS and Linux users, open the flash-all.sh script in a text editor to verify syntax, or execute the individual partition commands manually to prevent shell interpretation errors. The manual flash sequence consists of the following terminal commands executed in exact order:
fastboot flash bootloader bootloader-hammerhead-*.imgfastboot reboot-bootloaderfastboot flash radio radio-hammerhead-*.imgfastboot reboot-bootloaderfastboot update image-hammerhead-*.zip
Step 4: Post-Flash Wipe and First Boot
Once the automated script or manual sequence finishes writing the bootloader, radio, boot, recovery, system, and vendor partitions, the script will automatically instruct the device to reboot. However, to prevent boot loops caused by legacy cache configurations, it is considered a best practice to manually boot into Fastboot Mode one final time. Use the volume keys to highlight Recovery Mode, press the power button to select it, and once the "No Command" screen appears, hold Power and tap Volume Up to access the stock recovery menu. Select Wipe data/factory reset and Wipe cache partition to ensure a clean operating environment. Finally, select Reboot system now. The initial boot sequence following a factory image installation can take up to 10 to 15 minutes as Android builds its Dalvik/ART cache.
Google releases February security update factory images for Nexus devices
Nexus 5 Firmware Architecture & Partition Matrix
| Partition Name | Image Filename Prefix | Purpose & Technical Function |
|---|---|---|
| Bootloader | bootloader- |
Low-level initialization code responsible for hardware bring-up and kernel loading. |
| Radio (Baseband) | radio- |
Manages cellular modem firmware, IMEI configurations, and RF transceiver states. |
| Boot | boot.img |
Contains the Linux kernel and the Android RAMdisk for system initialization. |
| Recovery | recovery.img |
Secondary boot partition used for factory resets, sideloading updates, and maintenance. |
| System | system.img |
The core Android OS filesystem containing applications, frameworks, and binaries. |
| Userdata / Cache | cache.img |
Temporary scratch space for system updates and application temporary files. |
Common Flash Failures & Field Fixes
- Symptom: Command line displays "FAILED (remote: size too large)" during system image flashing.
- Root Cause: You are using an outdated version of the
fastbootbinary that cannot parse modern sparse image file allocations. - Actionable Fix: Download the absolute newest version of the Android SDK Platform-Tools package directly from Google and replace your existing
fastbootbinary before running the command again.
- Root Cause: You are using an outdated version of the
- Symptom: Device remains permanently stuck on the Google logo or boot animation screen post-flash.
- Root Cause: Residual cache data or conflicting encrypted file structures remaining from a previous custom ROM installation.
- Actionable Fix: Force the device back into fastboot mode, boot into stock recovery, and manually execute a full factory data reset and cache wipe.
- Symptom: Fastboot command window hangs indefinitely at "waiting for any device".
- Root Cause: Driver signature enforcement on Windows or improper USB root hub allocation.
- Actionable Fix: Disconnect the USB cable, switch from a USB 3.0/3.1 port to a USB 2.0 port if available, reinstall the Google USB drivers via Device Manager, and restart the command prompt with administrative privileges.
Frequently Asked Questions
Can I install Android 7.0 Nougat or newer official factory content on the Nexus 5?
Google officially ended software support for the Nexus 5 with Android 6.0.1 (Marshmallow). Consequently, Google does not provide official factory images for Android 7.0 or higher for this hardware, meaning any newer version would require unofficial custom ROM distributions.
Do I need to unlock my bootloader to install factory images?
Yes. Unlocking the bootloader is a mandatory cryptographic prerequisite for writing new partitions via fastboot commands on official Nexus and Pixel hardware. Attempting to flash factory images on a locked bootloader will result in immediate remote signature verification errors.
What should I do if my computer cannot recognize the Nexus 5 in fastboot mode?
This issue is almost exclusively driven by missing or corrupted desktop USB drivers on Windows systems. Navigate to the official Android developer portal, download the standalone Google USB driver package, and manually update the Android bootloader interface driver through your system Device Manager.
Will restoring factory content fix a completely unresponsive or hard-bricked device?
If the device screen remains completely black, fails to vibrate upon connection, and refuses to register within the computer device manager as a fastboot or Qualcomm HS-USB QDLoader 9008 device, the hardware has suffered catastrophic eMMC flash memory failure or deep power management failure, rendering software restoration impossible.
Ensure your legacy development tools are kept secure and maintain strict version control over your platform binaries to guarantee seamless mobile firmware restorations. Explore our technical archives for more legacy hardware recovery guides and low-level firmware flashing tutorials.