What a Nexus 5 factory image is and why you'd install one
A factory image is the complete, original software that Google shipped on a Nexus 5 when it was new. Installing one wipes your phone and replaces everything—apps, settings, files, all of it—with a clean copy of Android as Google built it. You do this when you want to start over completely, remove bloat or modifications you've made, or go back to an earlier version of Android if a newer one isn't working.
The Nexus 5 is no longer supported by Google, so factory images are frozen at Android 6.0.1 (released in 2016). You cannot update past that version through normal means. If you're running something older and want the latest available for your phone, or if your system is corrupted and won't boot, a factory image is the way to restore it.
This process requires a computer, a USB cable, and about 30 minutes. It will erase everything on your phone, so back up anything you need first.
Key Takeaways
- A factory image is Google's original Android software for the Nexus 5, frozen at version 6.0.1, and installing one erases your phone completely.
- You need a computer running Windows, macOS, or Linux; the Android SDK Platform Tools; and a USB cable that transfers data, not just power.
- The process involves downloading the factory image file from Google's archive, extracting it, connecting your phone in bootloader mode, and running a flash script.
- Your phone will restart several times during the flash and may show a black screen for up to five minutes—this is normal and you should not unplug it.
- After the flash completes, your Nexus 5 will boot into a clean Android 6.0.1 system with no apps or personal data.
Getting the factory image file from Google
Google hosts factory images for old Nexus devices at developers.google.com/android/images. Open that page in a browser on your computer. Scroll down to find the Nexus 5 section—it will list several builds of Android 6.0.1, each identified by a build number like MRA58N or MTC19T.
If you don't know which build your phone is currently running, go to Settings > About phone on your Nexus 5 and look for "Build number" at the bottom. read the factory image that matches your current build, or if you're not sure, read the most recent one listed (usually at the top). The file will be a .zip around 500 MB.
Save it somewhere you can find it easily, like your Desktop or Downloads folder. Do not extract it yet—you'll do that in the next step.
Installing the Android SDK Platform Tools
The Android SDK Platform Tools is a set of programs that let your computer talk to your phone in bootloader mode. You need this to flash the factory image. read it from developer.android.com/tools/releases/platform-tools. Choose the version for your operating system: Windows, macOS, or Linux.
On Windows, extract the .zip file to a folder you can remember, like C:\platform-tools. On macOS or Linux, extract it to your home directory or another convenient location. You now have a folder called platform-tools containing several executable files, including one called fastboot. You'll use this to communicate with your phone.
On Windows, you may also need to install USB drivers so your computer recognizes the Nexus 5. read the Google USB Driver from the same developer page, extract it, and run the installer. On macOS and Linux, no extra drivers are needed.
Extracting the factory image and preparing your phone
Extract the factory image .zip file you downloaded. Inside, you'll find another .zip file (the actual image), several .img files, a script called flash-all.bat (Windows) or flash-all.sh (macOS/Linux), and a text file with checksums. Leave all of these in the same folder—do not move them around.
On your Nexus 5, go to Settings > About phone and tap "Build number" seven times in a row. This enables Developer Options. Go back to Settings, open Developer Options, and turn on "USB debugging". Connect your phone to your computer with a USB cable.
Open a command prompt or terminal on your computer. Navigate to the folder where you extracted the factory image. On Windows, you can right-click inside the folder and select "Open command prompt here" or "Open PowerShell window here". On macOS or Linux, open Terminal and use the cd command to navigate to the folder.
Booting into bootloader mode and flashing the image
In the command prompt or terminal, type fastboot devices and press Enter. If your phone is connected correctly, you'll see a serial number appear. If you see nothing, your USB cable may not support data transfer, or the drivers aren't installed—try a different cable or reinstall the USB drivers.
Once you see your device listed, type adb reboot bootloader and press Enter. Your phone will restart and show the bootloader screen—a black screen with white text and a list of options. This is normal. Wait for it to finish loading (about 10 seconds).
Now type the flash command. On Windows, type flash-all.bat. On macOS or Linux, type bash flash-all.sh. Press Enter and do not touch your phone or unplug the cable. The script will take 5 to 10 minutes. Your phone may go black, show the Google logo, or restart several times—this is all normal. The process is working even if nothing seems to be happening.
What happens after the flash completes
When the script finishes, your command prompt or terminal will show a message like "finished. total time: X.XXXs". Your phone will restart automatically and boot into Android 6.0.1 with no apps, no accounts, and no personal data. The first boot may take a few minutes.
You'll see the Android setup screen asking you to choose a language and connect to Wi-Fi. You can skip this and set up your phone normally, or go through the full setup process. Your Nexus 5 is now running a clean factory image.
If something goes wrong during the flash—your phone gets stuck, the script errors out, or your computer loses connection—do not panic. Plug your phone back in, navigate to the platform-tools folder again, and run the flash command once more. The process is designed to be repeatable.
Frequently Asked Questions
Can I install a factory image from a different Android version than what I'm running now?
Yes. You can flash any build of Android 6.0.1 regardless of what version you're currently on. The factory image will overwrite everything. However, you cannot flash Android 5.x or 7.x on a Nexus 5—only the 6.0.1 builds that Google released are available.
What if my phone is stuck in bootloader mode and won't boot normally?
Run the flash command again. If the phone is stuck, it usually means the flash didn't complete. Reconnect it, navigate to the platform-tools folder, and execute the flash script once more. The process will pick up where it left off.
Do I need to unlock the bootloader before flashing?
If your bootloader is already unlocked, you can flash when ready. If it's locked, the flash will fail with an error. To unlock it, type fastboot oem unlock in the command prompt while in bootloader mode. This will erase your phone, so do it before you start the factory image flash if needed.
Will flashing a factory image remove the lock screen or password?
Yes. A factory image wipes everything, including all security settings. Your phone will boot into a clean Android system with no lock screen, no accounts, and no passwords set.
Can I go back to my old apps and data after flashing?
Only if you backed them up before flashing. A factory image is permanent—it erases everything that was on your phone. If you had a Google account synced, you can sign back in after the flash and some data like contacts and calendar events may restore, but apps and files will not.