yashsingh1/xdaforums huggingface dataset:
[Nexus 5 General] abaaaabbbb63:
Well, you did not install fastboot properly. In the Setting up section, you'll find a guide for windows (redmondpie) to install adb and fastboot. Use it to make it work.
[Nexus 5 General] jj14:
What is this tamper flag being referred to in the third post here? http://xdaforums.com/showpost.php?p=47381064

Could you (@abaaaabbbb63) add the reference to reset that too (into the first post)? (the last post in the thread above refers to a way to reset that - but that script is more than just resetting the tampered flag).
[Nexus 5 General] abaaaabbbb63:
I will.
[Nexus 5 General] osm0sis:
Have you tried the zip? It's a recovery flashable zip script that toggles the lockstate and always sets tampered to false. That should answer most of your questions right there. The part you quoted has mako code in it though, you'll probably want hammerhead if you're running it manually.

Why would you bother to reset the tamper flag if you want the stock recovery image? Anyway, if that's what you want to do for some reason then reflash stock recovery, then boot cwm/twrp temporarily to relock and reset the tampered flag:

fastboot flash recovery recovery.img

fastboot boot cwm.img

You might also just be able to fastboot oem lock and have it keep the tampered flag set to false from an earlier flash, not sure how that works, I just know it gets set to true when you unlock.
[Nexus 5 General] abaaaabbbb63:
oops... quoted the wrong phone

I'm just trying to figure all of this out to put it in the OP. From what I've read, flashing the factory images doesn't reset the tamper to false. And, for warranty purposes, people will want to reset it when flashing the factory images, to , for example, RMA a Nexus 5.

That's why I was talking about a script that serves the sole purpose of resetting the tamper to false, without locking the bootloader.
[Nexus 5 General] gd6noob:
After extracting the file, I get 1 file.. "hammerhead-krt16m-factory-bd9c39de" there is no extension, just that string of letters..
[Nexus 5 General] DigginGraves:
What OS are you using? Use WinRAR to extract the tar.gz
[Nexus 5 General] gd6noob:
ok nevermind.. I redownloaded the file and it was fine.. maybe a bad download??

*EDIT*

WOW.. nice.. thanx it work... I didnt have to do that erase data part, after flashing the phone rebooted itself and about 1-2mins it booted into android!

Thanks you so much

Do you recommend CWM or TWRP? I have been using TWRP probably ever since.. but heard it wasnt as good/safe as CWM...
[Nexus 5 General] fly23:
Maybe my understanding of the english language is not the best. but why is he writing "extract" here? For minutes I tried to find a tool to unpack the img-file on OSX. But the only thing to do, was renaming is to bootloader.img.

And I hate all these bobs, who say, this takes only 5 minutes. sure, if you flash your device every two weeks. I didn't do this at the first time, but it's is always some months away. Incl backup of data + restore this tool me from 2.30 am to 6.15 am.
[Nexus 5 General] gamer.11:
For those who are not using the flash-all.bat and doing it the long way don't forget to add the following piece of code after "fastboot erase cache"

I forgot and it did not allocate my cache partition: result? bootloop and error in recovery.

fastboot flash cache cache.img

[MENTION=4346614]abaaaabbbb63[/MENTION] update the OP?
[Nexus 5 General] Harley101:
How should I back up before flashing factory image and returning to stock. The Helium app will not work with the Android L Preview. adb backup is broken....

Is there any other safe and tested back up app that I can use in lieu of Helium when upgrading to Lollipop?
[Nexus 5 General] mongoosepanda:
I searched around for an answer for you and you could try Backup+

http://www.xda-developers.com/android/backup-lets-you-backup-your-app-data-on-android-lollipop/

Although I'm not sure if that'll be able to help you with your back up issue.
[Nexus 5 General] random_raymond:
Hey guys,

Was using Method 2 from OP and all was going well - every step of the fastboot flash was written OKAY.

Then I got to the last step - Wipe data / Factory data reset in recovery. This step is now showing the following:

-- Wiping data...

Formatting /data

and it is STUCK on this. Has been stuck here for about 20 minutes, no result. Anyone know what I can do?

Thanks!
[Nexus 5 General] abaaaabbbb63:
First, try simply booting. If it gets stuck, do this:

Hold power button until the phone shuts down, boot in recovery and use these commands:

fastboot erase data

fastboot erase cache

And then reboot
[Nexus 5 General] random_raymond:
Thanks it worked!!!
[Nexus 5 General] LiranL:
Cant install Android 5

Hi

I get this errors (attached)

what to do ??
[Nexus 5 General] vpraveenis:
Have you unlocked your bootloader with "fastboot oem unlock" If not, you need to do it first and it will wipe your data.
[Nexus 5 General] vijaysivakula:
Phone Memory halved

HI,

I flashed Lollipop using these instructions. But now my phone shows only 16 GB space instead of 32 GB space. What should I do? Should I flash again? Do we have the complete instructions somewhere to do it properly? "flash-all.bat" did not work for me.

Regards.
[Nexus 5 General] Kratos90:
Instructions on correcting this are in the second post. Good luck
[Nexus 5 General] siren215:
erase your cache and/or flash cache.img again.
[Nexus 5 General] bush911:
How do I flash factory image and root and flash twrp in turn?

Should I flash factory image then CF-AUTO-ROOT.IMG then twrp.img ?

I have driver installed for 4.44 , do I need to upgrade driver?

Your comments will be greatly appreciated

Regards,
[Nexus 5 General] my27:
flash to reset tamper flag on Lollipop

can i do flash the same zip file on kitkat base to Lollipop sir ??
[Nexus 5 General] croikee:
Failed to Load Image

Can someone help me please? I'm trying to flash 5.0 to my Nexus 5. I have unzipped the right hammerhead zip (I'm 95% sure) into the platform-tools folder which contains my fastboot file in it. I put my phone into fast boot mode (its unlocked, I flashed to 4.4. 4 this way). When I run the flash-all.sh command in terminal (on mac) I get the following dialog:

error: cannot load 'bootloader-hammerhead-hhz12d.img'

rebooting into bootloader...

OKAY [ 0.055s]

finished. total time: 0.056s

error: cannot load 'radio-hammerhead-m8974a-2.0.50.2.21.img'

rebooting into bootloader...

OKAY [ 0.048s]

finished. total time: 0.048s

error: failed to load 'image-hammerhead-lrx21o.zip': No such file or directory

Any thoughts on what this could be? My phone flashes just before every error. Would love any help, thank you!
[Nexus 5 General] abaaaabbbb63:
I do believe so. It shouldn't be OS dependent.
[Nexus 5 General] Edronax:
Yes, and it works.
[Nexus 5 General] gee2012:
Because you didn`t copy the bootloader, image and radio img`s into the fastboot folder ;)
[Nexus 5 General] croikee:
Okay I feel dumb but where do I get the bootloader and radio imgs?
[Nexus 5 General] gee2012:
In the .tar file you extracted or download from here https://www.dropbox.com/sh/p3qhb8xt6aae5s4/AADmh1CDcF4vMTaHRlsEPFuqa?dl=0 for Lollipop Official.
[Nexus 5 General] matan_sagee:
I have the same problem, and i'm sure i copied the bootloader and radio img`s into the fastboot folder - C:\Program Files (x86)\Android\android-studio\sdk\platform-tools
[Nexus 5 General] gee2012:
Just extract the downloaded firmware with 7-zip, then you get a folder with a .tar file you also have to extract with 7-zip and you end up with a map with 3 img files and 3 flash all/batt files which you all copy to the platform-tools folder.

BTW: the Android-Sdk folder must be installed straight on the C drive, NOT in Program files or other sub folders. So C:/android-sdk!
[Nexus 5 General] ofteno:
how long it takes to start?

I flashed lollipop and its taking way too long :(
[Nexus 5 General] matan_sagee:
I did exactly as you said.

i got all the 6 files,

1. bootloader-hammerhead-hhz12d.img

2.flash-all.bat

3.flash-all.sh

4.flash-base.sh

5.image-hammerhead-lrx21o.zip

6.radio-hammerhead-m8974a-2.0.50.2.21.img

and i still get

C:\WINDOWS\system32>flash-all.bat

error: cannot load 'bootloader-hammerhead-hhz12d.img'

rebooting into bootloader...

OKAY [ 0.061s]

finished. total time: 0.064s

error: cannot load 'radio-hammerhead-m8974a-2.0.50.2.21.img'

rebooting into bootloader...

OKAY [ 0.068s]

finished. total time: 0.069s

error: failed to load 'image-hammerhead-lrx21o.zip': No such file or directory

Press any key to exit...

what else can i do? thanks!
[Nexus 5 General] gee2012:
Installed the android-sdk straight to the C drive (not in a folder)?

Fastboot drivers installed correctly? Is your device recognised when you type in cmd: `fastboot devices` and do you see a serial number?
[Nexus 5 General] matan_sagee:
i installed the android-studio on C:\android-studio\sdk\platform-tools

i get

C:\WINDOWS\system32>fastboot devices

0449e30a2523b801 fastboot

my PATH is C:\android-studio\sdk\platform-tools

How can i check if Fastboot drivers installe correctly?

i use android sdk platforms-tools 21 & sdk tools 23.0.5..

and still:

C:\WINDOWS\system32>flash-all.bat

error: cannot load 'bootloader-hammerhead-hhz12d.img'

rebooting into bootloader...

OKAY [ 0.051s]

finished. total time: 0.055s

error: cannot load 'radio-hammerhead-m8974a-2.0.50.2.21.img'

rebooting into bootloader...

OKAY [ 0.070s]

finished. total time: 0.071s

error: failed to load 'image-hammerhead-lrx21o.zip': No such file or directory

Press any key to exit...

thanks, really appreciate
[Nexus 5 General] gee2012:
No idea anymore mate, just coming back to the N5 (will get it tomorrow) as the N6 is too big for me. Hope someone else can help you :good:
[Nexus 5 General] matan_sagee:
ahaha thanks dude...

i think i got the answer.. just need to get to the dir that the files in it

C:\android-studio\sdk\platform-tools>flash-all.bat

target reported max download size of 1073741824 bytes

sending 'bootloader' (2579 KB)...

OKAY [ 0.272s]

writing 'bootloader'...

OKAY [ 0.476s]

finished. total time: 0.754s

rebooting into bootloader...

OKAY [ 0.083s]

finished. total time: 0.087s

target reported max download size of 1073741824 bytes

sending 'radio' (45521 KB)...

OKAY [ 1.587s]

writing 'radio'...

OKAY [ 3.119s]

finished. total time: 4.710s

rebooting into bootloader...

OKAY [ 0.081s]

finished. total time: 0.086s

target reported max download size of 1073741824 bytes

archive does not contain 'boot.sig'

archive does not contain 'recovery.sig'

failed to allocate 1005154516 bytes

error: update package missing system.img

Press any key to exit...

this seems like a problem with a solution

thanks again
[Nexus 5 General] mongoosepanda:
It should only take 10 minutes. Also the brightness should change during the boot as said by afraaa.
[Nexus 5 General] Harley101:
Thanks. Update to Lollipop successfully carried out!
[Nexus 5 General] francescobabbaro:
Hi guys, thanks for this simple guide, but I have a question: it may be a stupid one, but if I lock the bootloader with that zip (which change the tamper flag from "true" to "false", too) that I have to flash via custom recovery, then how I can return to stock recovery? I really don't understand... Thanks a lot.
[Nexus 5 General] jd1639:
You flash the stock recovery with fastboot first. Then you just boot into twrp and flash the zip. You don't flash twrp
[Nexus 5 General] francescobabbaro:
But how I boot into twrp? In the guide there is a .img file of this recovery that I have to flash via fastboot: is it a temporary recovery? Thanks a lot.

EDIT: Sorry, I have seen now... xD .
[Nexus 5 General] :
In that phase you don't flash the recovery, you boot it temporarily. Compare the commands:

1. "fastboot flash recovery recovery.img"

2. "fastboot boot C:/recovery.img"

The first one is used earlier to FLASH stock recovery. The second is used at the end to BOOT INTO but NOT FLASH twrp so you can flash that flag script
[Nexus 5 General] drshafi:
Had same problem? Is there any way to flash stock recovery from twrp without fastboot method? I am on twrp recovery now from Wugfresh's Root Toolkit.

Or else can i flash stock recovery img file via flashfy? If yes please provide me stock recovery.img file please.
[Nexus 5 General] smrdelj:
Hi everyone. Strictly following the steps in this guide, I installed on my Nexus 5 Lollipop (Google's factory image of wednesday 12). Android works perfectly. But when trying to boot into recovery mode, the phone stays frozen in the image of Android's bug, as if loading forever. No word on the screen, only the drawing of Android. And, the phone does not react at all, no combination of buttons makes something happen. Therefore, there is no way to even reboot. As if bricked. Luckily, I connected it to the wall charger and reacted, so I continued with the installation of Lollipop without previous wipe, and go until today without problem.

What can I do? I mean, Android works perfectly fine, so i could continue in this state. But I have no recovery! And that could be problematic, of course.

What do you recommend? Please note that I do not understand a lot of flashing, so if there is any very simple method or tool, it would be much better for me.

Thank you very much for your help!
[Nexus 5 General] Mindspin_311:
OK, did I mess something up?

I did the flash-all.bat command, saw where there were a few .sig parts missing, but it kept going. Finally got a message where it said press any key to continue.

I had the phone continue to boot, got android with spinning cube thing, now Im sitting at the boot animation (flying colored dots). Is this part of the 10min boot up?
[Nexus 5 General] mongoosepanda:
Has the brightness changed at all during the boot? From dim to bright?
[Nexus 5 General] Mindspin_311:
Yes, and it actually just booted up. Got all the setup prompts now. Seems to be good to go.
[Nexus 5 General] mongoosepanda:
Awesome! That's great to hear it's a bit unnerving having to watch the orbs spin around for 10 minutes or 20 minutes and being stuck in a loop if you're like me and forgot to factory reset after doing method 2 :P.
[Nexus 5 General] Mindspin_311:
Yea, totally forgot to factory reset, but it seems to be functioning fine.

I miss my tiles. How do I clear all notifications at once?
[Nexus 5 General] mongoosepanda:
When you pull down the notifications you'll still see the 3 bars to clear all notifications they're at the bottom right of the last notification.
[Nexus 5 General] divinewisdom:
I am in the same boat. I dont have recovery, it shows the adriod bot with the red triangle every time i try to get into recovery. I cant side load apk's either. anyone can help?
[Nexus 5 General] coolek33:
Press vol+ (or vol- don't remember exactly) and power together again when you see dead android to bring recovery menu.
[Nexus 5 General] Cocktopus:
Guys, Can i get the boot.img from the lollipop factory img?
[Nexus 5 General] abaaaabbbb63:
Well, if no combination of buttons work, then try reflashing the stock recovery.

Otherwise, try flashing a custom recovery.

Yes, you can. Download it, and flash the boot.img separately using fastboot.
[Nexus 5 General] drshafi:
Still no answer of my question?
[Nexus 5 General] abaaaabbbb63:
You could, in theory, take a flashable zip of any other recovery, and replace the recovery.img file with the stock one.
[Nexus 5 General] vlatkonexus4:
Thanks so much

This is the best thread about restoring N5 to factory settings and flashing it

It works like a charm even with lollipop factory images

Keep up the good work man:good:
[Nexus 5 General] nexus5fan:
Getting error when using method 2 help needed

Hi im kinda new to all of this wanted to put lollipop on my n5 but now its all screwed up. I started by using wugfesh nexus root toolkit was able to unlock and root the phone but then somehow deleted my os ive been up all night trying to fix this. I tried to use method 1 but it came up with an error telling me it couldent load my hammerhead 4.4.4 zip file.. I booted into recovery and deleted all i could to get back to sqaure one now im trying method 2 and so far have got the bootloader and radio loaded but now on doing the same for system.img get Load_file could not allocate 738714620 bytes error: cannot load system.img what am i doing wrong need this phone fixed asap its my only phone. Please can anyone help me with this issue

Thanks

Edit got it fixed now working again :D
[Nexus 5 General] AvivEliyahu:
Takes me around 10-15 minutes (its still writing) to flash the userdata.img .. anyone else had this? (speaking about the android 5.0 image)
[Nexus 5 General] abaaaabbbb63:
Well, what I would do is erase the system first, then flash the new one. But it's risky, cause you lack experience.

When you say "deleted my os", you say it doesn't boot anymore?

Ok, try this (be careful).

write "fastboot erase system"

then

"fastboot flash system /path/to/system.img"

You can skip userdata if you want. As long as you flashed system and boot, then you're good to go.
[Nexus 5 General] smrdelj:
Ok, thanks! 3 questions:

1) Do you recommend for flashing recovery to follow this guide also? (http://xdaforums.com/google-nexus-5/general/guide-nexus-5-how-to-unlock-bootloader-t2507905).

2) What custom recovery would you recommend?

3) Will the process erase/format my current Lollipop?

Thank you very much!!
[Nexus 5 General] abaaaabbbb63:
1. Yes, it's a good anti-kitten-death guide.

2. I personally use TWRP.

3. If your bootloader isn't unlocked, then yes. (It probably is,right? Then don't worry)
[Nexus 5 General] jd1639:
1. The guide will work fine. You just need fastboot flash recovery recovery.img

2. Use twrp for the custom recovery

3. Flashing recovery will not wipe anything

Edit, nuts, I'm too slow, lol
[Nexus 5 General] smrdelj:
Thank you both, I flashed TWRP and on first reboot all went OK (I actually get into TWRP recovery). And also tryed to root. But then, when I went for second time to recovery, the phone loaded the default one, te original/factory. Inexplicable. So i flashed it again, and happened excatly the same.

But i really dont mind, because now with this:

Now the default recovery works fine. No more bricked sensation.-

Thanks to all of you!
[Nexus 5 General] jball:
I used method #1 to flash 5.0 lollypop factory image wile on 4.4.4 with no problems. Everything is all good .now my backup device is up to date .so now I wait to update my GPE converted HTC ONE M8 to official 5.0

Super simple for sure,thank you
[Nexus 5 General] mgf8384:
For some reason i cannot get TWRP to boot. I just get a lot of commands etc in the command box. Dont understand what im doing wrong? Phone just sits in fastboot.
[Nexus 5 General] jd1639:
Make sure you've typed everything correctly

fastboot flash recovery recovery.img where recovery.img is the name of your recovery image file
[Nexus 5 General] coolek33:
Maybe a bad download? Do it again just to be sure. Check md5/sha1
[Nexus 5 General] Rolo42:
Modified Method 2 to upgrade from KK to L

*** EDIT: Keeps 32GB version at 32GB! ***

I took most of Method 2 (sans lock/clear tampers) to perform a clean upgrade to Lollipop (OTA would have failed miserably and trying to undo all the hacks would have been longer and too arduous).

Entirety of what I did (Windows batch file):

fastboot devices
@pause
fastboot erase boot
@pause
fastboot format cache
@pause
fastboot erase recovery
@pause
fastboot format system
@pause
fastboot format userdata
@pause
fastboot flash bootloader bootloader.img
@pause
fastboot reboot-bootloader
@pause
fastboot flash radio radio.img
@pause
fastboot reboot-bootloader
@pause
fastboot flash system system.img
@pause
fastboot flash userdata userdata.img
@pause
fastboot flash boot boot.img
@pause
fastboot flash recovery recovery.img
@pause
fastboot reboot-bootloader
@pause
fastboot oem device-info
@echo Perform factory reset (select recovery, hold Power+tap VolUP).
@echo Reboot to system; verify 32GB storage; reboot to bootloader (Power+VolDN).
@pause
fastboot devices
@pause
fastboot flash recovery twrp.img
@pause
fastboot boot cfautoroot.img
@echo Boot system; install SuperSU, Root Validator, BusyBox.

cfautoroot.img is just renamed from CF-Auto-Root-hammerhead-hammerhead-nexus5.img

twrp.img is renamed TWRP 2.8.1.0 img

All other images are from factory lollipop download and extracted to the same directory as adb/fastboot

The initial boot took <6 minutes

I'm with the thread author in that I don't like one-click tools (to include scripts/batch files) because if something doesn't go as expected, it could do more damage and be difficult to fix. Besides, I like to learn how things work. The pauses and device commands are there to verify each step works before proceeding (and to wait until the step finishes/USB reconnects), hitting CTRL-C if anything were to fail.
[Nexus 5 General] Essedge:
Following method 1 and when i get to:

★Select "Wipe data/factory data reset"

It still shows me as having the Lollipop recovery. One thing of note, I extracted archive for kitkat 4.4.4 and the flast-all.bat would error out as there was no fastboot application for it to use so i moved all of the files to my sdk/platform-tools directory. When i ran the flash-all.bat from there it gets passed the fastboot reboot then I get "program has stopped working" error.

Ideas?
[Nexus 5 General] Rolo42:
"program has stopped working" error in Windows? If so, you have an issue with your PC, USB, drivers, SDK install, something in the box.

Does the command fastboot devices list your device when it is connected and in the bootloader? If not, then you aren't talking to your phone. Try method 2 to see what works/fails.
[Nexus 5 General] Essedge:
Yea I must not have installed the SDK stuff correctly, I tried again from my main rig and everything seemed to work except:

★When a small dead Android appears, press Power Button + Volume UP.

^^ this never happened, it went right to loading kitkat, is that a good/bad thing?
[Nexus 5 General] mrcoco99:
I have followed all the steps multiple times, and flashed 5.0/4.4.4 with no errors, but the phone always freezes during the boot animation / the initial screen (updating apps/choose language).

Is there any way to reset it even more, or does anyone have any idea on what to do?
[Nexus 5 General] jd1639:
Have you done a factory reset in the stock recovery? That'll wipe your data so be forewarned
[Nexus 5 General] tvrtkocro28:
I m on lolipop trying to flash kitkat image do i need to enable USB debugging ? :)
[Nexus 5 General] jd1639:
No, not to flash the image in fastboot
[Nexus 5 General] mrcoco99:
Yes, many times. I think I've done all the default troubleshooting procedures, both via toolkits and manually

But I'm still open to suggestions, since I can't access my phone anyways
[Nexus 5 General] jd1639:
What happens if you lock your bootloader and reboot? Does it stay locked or is it unlocked?
[Nexus 5 General] tvrtkocro28:
Thanks , now it works , flashed kitkat everything works but playstore shows no connection (i m connected and everything else with internet works..) :/
[Nexus 5 General] mrcoco99:
It stays locked
[Nexus 5 General] Rolo42:
I would say "pilot error"

Prior step (★After everything finished, select "Recovery" using the volume buttons.) wasn't done or

Current step (you have to hold Power and tap VolUP to get the stock recovery menu) or

or you don't have the stock recovery installed

Factory reset doesn't erase everything. The script I posted earlier erases/formats everything (or just about everything...I don't know what else to nuke). Run the commands yourself using the script as a guide or do exactly what I did (it works and it doesn't castrate the 32GB storage).
[Nexus 5 General] Essedge:
Selected "Recovery" and the dead droid did not appear, went right into what looks like an initial startup of kitkat. Everything seems to be working correctly, is there a way to double check that I have the stock recovery installed?
[Nexus 5 General] Essedge:
Interestingly I was having issues with my phone being recognized by laptop while not in a storage mode and I fastbooted, hit recovery mode again and this time I did get a dead droid. Did the factory wipe just in case.
[Nexus 5 General] mezo91:
How can i downgrade from official android L to 4.4.4?