• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods [Guide]How to flash a Nexus Factory Image manually.

Does the Flash-All method for Lollipop bypass all of the steps you posted?

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

If you take a peek in that flash-all script you can see exactly what it's doing. Based on my memory, it:
  1. Flashes the bootloader image.
  2. Reboots.
  3. Flashes the recovery image.
  4. Reboots.
  5. Flashes the modem/radio image.
  6. Reboots.
  7. Flashes system, userdata, and cache images all at once.
  8. Reboots.
So you still need to do the fastboot oem unlock step (to unlock the bootloader), but you can otherwise just execute Flash-All and call it a day*.

* Unless something fails to flash, which seems to be a commoner and commoner thing lately. You'll then likely need to flash the filesystems individually as described at the top of this thread. ;)
 
Upvote 0
If you take a peek in that flash-all script you can see exactly what it's doing. Based on my memory, it:
  1. Flashes the bootloader image.
  2. Reboots.
  3. Flashes the recovery image.
  4. Reboots.
  5. Flashes the modem/radio image.
  6. Reboots.
  7. Flashes system, userdata, and cache images all at once.
  8. Reboots.
So you still need to do the fastboot oem unlock step (to unlock the bootloader), but you can otherwise just execute Flash-All and call it a day*.

* Unless something fails to flash, which seems to be a commoner and commoner thing lately. You'll then likely need to flash the filesystems individually as described at the top of this thread. ;)

Thanks a ton for this, I've been looking at many places for this answer! Just one more quick question, do you I have to execute the erase steps?

fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system

Not a major issue, just wasn't sure if it was necessary.
 
Upvote 0
Thanks a ton for this, I've been looking at many places for this answer! Just one more quick question, do you I have to execute the erase steps?

fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system

Not a major issue, just wasn't sure if it was necessary.
Probably not strictly necessary, as those filesystems get overwritten when you flash them, but it's probably a good idea to do it just to make sure you start from a clean slate. :thumbsupdroid:
 
  • Like
Reactions: redkulat89
Upvote 0
I am stuck using your guide
How to flash a Nexus Factory Image manually. I have a nexus 5 that I completely screwed up trying to revert back to stock from root. Maybe it's looping. I am stuck here:

Step 9: We will now flash the bootloader. It is important that you do not disconnect the device or mess with it during this step or else you hard brick the device.
fastboot flash bootloader "name of boot loader"

This is what happens in the terminal:

./fastboot-mac flash bootloader-hammerhead-hhz12h.img
unknown partition 'bootloader-hammerhead-hhz12h.img'
error: cannot determine image filename for 'bootloader-hammerhead-hhz12h.img'

Thanks for your continued help.

Ted
 
Upvote 0
I am stuck using your guide
How to flash a Nexus Factory Image manually. I have a nexus 5 that I completely screwed up trying to revert back to stock from root. Maybe it's looping. I am stuck here:

Step 9: We will now flash the bootloader. It is important that you do not disconnect the device or mess with it during this step or else you hard brick the device.
fastboot flash bootloader "name of boot loader"

This is what happens in the terminal:

./fastboot-mac flash bootloader-hammerhead-hhz12h.img
unknown partition 'bootloader-hammerhead-hhz12h.img'
error: cannot determine image filename for 'bootloader-hammerhead-hhz12h.img'

Thanks for your continued help.

Ted

The syntax for "fastboot flash" (or the Mac equivalent) is:
fastboot flash <partition> <filename>

You're not giving it a valid partition name. ;)

So try:
Code:
./fastboot-mac flash bootloader bootloader-hammerhead-hhz12h.img

I bet you'll have better luck. :thumbsupdroid:
 
  • Like
Reactions: lunatic59
Upvote 0
I got a few errors during step 11
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
archive does not contain 'vendor.sig'

and now my phone is stuck at the initial Google screen? Suggestions?
Hi and welcome to Android Forums :)

Could you provide us some additional information - like what device you have and what version you're trying to flash?

Those "archive does not contain..." messages aren't generally an error-level message as I recall... those shouldn't be causing the installation to fail. Is there any other output you could share?
 
  • Like
Reactions: vabvaibhav
Upvote 0
Hi and welcome to Android Forums :)

Could you provide us some additional information - like what device you have and what version you're trying to flash?

Those "archive does not contain..." messages aren't generally an error-level message as I recall... those shouldn't be causing the installation to fail. Is there any other output you could share?
I am using a Nexus 4 and I tried to flash the most recent version from the google website.

After I saw those errors, I tried installing the other way (using the four commands) and I got done without any errors. The phone froze at the first Google screen... and then I passed out.

When I woke up, I tried to boot the phone. It got to the four dots animation and froze there. I plugged it back into charging and then I saw a constant red LED (no flashing).

Since then I have not been able to boot the phone, normally or in bootloader.
 
Upvote 0
Are you sure it doesn't say boot.img? I get that when trying to use the flash-all.bat script, too. It's just a matter of unzipping the archive that does contain those images and flashing them individually.

Try this. Read that post and the one following to see if that's your problem.
I just unzipped everything into one giant folder. The installation was executed perfectly without any errors and as per the instructions.
icuCpJl.png
 
  • Like
Reactions: lunatic59
Upvote 0
Umm.. If I remember correctly, I saw the phone reboot and it rebooted into the "optimizing apps screen". Before that, the phone got really slow, almost unresponsive. I first went with factory reset which went smooth. But then the phone froze at the optimizing apps screen again. Then I tried to flash it and it stopped at the Google screen. The most recent freeze was the moving dots animation for lolipop.
 
  • Like
Reactions: codesplice
Upvote 0
How long did you let it "optimize"? That can take what seems to be an unreasonably long time after a fresh flash. Follow @codesplice 's recommendation and make sure you have a full charge.

Sometimes a failed flash or failed boot can leave the phone in a "semi-on" state where it's really on but frozen. Try holding the power button for 30 seconds or so and see if you can get any kind of response. You might try it with the volume buttons as well at this point.

As they say in Brooklyn ... cuddint hoit. ;)
 
Upvote 0
HEY GUYS! GUYS!
I use a 20AWG cable for faster charging and it prevents the phone from going into data transfer mode, and another cable for doing everything else. So, apparently, my phone wasn't charging last night while it was plugged in. I followed what @codesplice said and let the phone charge and.... VOILA! Google Welcome screen asking me for my language. It is running smoothly now.

You guys saved me from buying a new phone. I should probably do it eventually since I have been dropping my 'mako' regularly for the past two years. :D

I can't thank you enough for all your help and looking for options even though I had lost hope. You guys are AWESOME! I wish I was as cool and knowledgeable as you! Keep Rockin' :)
 
Upvote 0
Great news!! Always nice to hear a success story. Could you clarify something for me though? Which one of us is "cool" and which is "knowledgeable"? I need it for the jackets. ;)
If I was asked to split the hair, I would say that you come off as a little more "cool" with your writing style as you try to boost the morale of the person whose beloved device is dying, whereas @codesplice writing is pointed at bringing the poor device back to life and putting the person out of misery. You make a great duo! :')
 
Upvote 0
This is a guide for all those who run into a circumstance that requires a complete return to stock. Most people who have windows can avoid this through the use of a toolkit like Wugs, but that still leaves those on Macs or Linux behind.

Step 1: Make sure the fastboot drivers are installed & configured if your OS requires them. The easiest way is to use Koush's Universal drivers found here: Universal Driver

Step 2: Make sure you have the fastboot files. You can get it from our mini-sdk here on the forums.

Step 3: Download the factory image from Google Developer website. The latest builds are listed below:

Once downloaded, extract the .tzg into the same folder you put the sdk files.

Step 4: Make sure the device is connected to the computer while in fastboot mode. Different devices may require different commands to get into fastboot mode. Make sure the device is powered off and then use the following button commands:

  • Nexus S - Vol Up + Power
  • Galaxy Nexus - Vol Up + Vol Down + Power
  • Nexus 7 - Vol Down + Power
  • Nexus 4 - Vol Down + Power
  • Nexus 5 - Vol Down + Power
  • Nexus 10 - Vol Up + Vol Down + Power
  • Nexus 9 - Looking to Confirm
  • Nexus 6 - Vol Down + Power
Step 5: Open up a command line terminal and navigate it to the location where the factory image and fastboot files are located. This can be done with the following command
Windows users can take a shortcut by having the folder open with windows explorer and then using the combo of Shift + Ctrl + right click and then clicking on "Open session window here"

Step 6: All commands are going to be executed through the fastboot binary.
Windows:
Mac:
Linux
For simplicity, I'm only going to progress using windows commands because it's simpler. First we want to make sure the computer sees the device. Use the command:
This should return a device ID if it's recognized. If nothing is returned, it means your device is not connected in fastboot mode, or the drivers aren't installed/configured correctly.

*Note* Steps 7 and/or 8 will wipe the device completely. So if you wish to back anything up, do it now.

Step 7: If your bootloader is already unlocked, skip this step. If it is not, it has to be unlocked in order to flash anything. To do this, use the command:
Use the Vol Up to go up to yes and then use the power key to select. The device should now be unlocked

Step 8: We now want to wipe the device. Use the following commands in order:
Step 9: We will now flash the bootloader. It is important that you do not disconnect the device or mess with it during this step or else you hard brick the device.
Step 10: If using a phone or data enabled tablet, we will now flash the mobile radios. Some phones have more than one radio file. Flash the CDMA radio after the LTE radio.
Step 11: We will now flash the system, boot, and recovery all in one shot with the following command:

Alternatively, you could extract all the .img files in the zip file and flash them manually one at a time. This makes things really handy if you're using the factory image to act as an update rather than a complete return to stock. If trying to update using the factory image, extract the .img from the zip file into the same directory as your bootloader and radio img files and execute the following commands in order:

If going for a complete back to stock using the manual flashing of the zip file, execute the following commands after the above 4:
Step 12: The device now has been flash back to stock. Only one thing left to do is reboot.
Your device will now reboot and should be completely back to stock as well as be unrooted.
YOU!! YA YOU! UR AWESOME :D This helped me after having a soft bricked nexus 5 for days evns nrt wasnt working for me :D Thx ALOT
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones