[Q] Wipe device and install factory image via adb? - Nexus 4 Q&A, Help & Troubleshooting

N4 is broken, but I can use adb commands by going into recovery mode. I'd like to fully wipe the device and install the JWR66Y factory image (which is currently saved on my PC as a .tar file). I'm kind of an adb newb/idiot. I would greatly appreciate any guidance here.
Thanks!

Can you use fastboot to flash stock?
http://androidforums.com/android-sy...e-how-flash-nexus-factory-image-manually.html
Swyped from my Nexus 4 using Tapatalk 4

ddb540 said:
N4 is broken, but I can use adb commands by going into recovery mode. I'd like to fully wipe the device and install the JWR66Y factory image (which is currently saved on my PC as a .tar file). I'm kind of an adb newb/idiot. I would greatly appreciate any guidance here.
Thanks!
Click to expand...
Click to collapse
Hey you might want to look at the Google Nexus Toolkit. You can sideload a file if you already have a custom recovery installed.
http://forum.xda-developers.com/showthread.php?t=1995688
Good luck!

Lord Yurij said:
Can you use fastboot to flash stock?
http://androidforums.com/android-sy...e-how-flash-nexus-factory-image-manually.html
Swyped from my Nexus 4 using Tapatalk 4
Click to expand...
Click to collapse
Thank you for the response. Was able to push the jwr66y image to the device using adb in recovery mode. Then, did the following:
fastboot boot boot.imdg
fastboot system jwr66y.imdg
fastboot erase userdata
fastboot erase cache
fastboot reboot
Now device is stuck in boot loop. Suggestions?
Thanks!

ddb540 said:
Thank you for the response. Was able to push the jwr66y image to the device using adb in recovery mode. Then, did the following:
fastboot boot boot.imdg
fastboot system jwr66y.imdg
fastboot erase userdata
fastboot erase cache
fastboot reboot
Now device is stuck in boot loop. Suggestions?
Thanks!
Click to expand...
Click to collapse
How did the command "fastboot system" even work?
When you flash an image, the command is the following:
Fastboot flash boot boot.img
Fastboot flash system system.img
Fastboot flash userdata userdata.img
Etc.
Anyways, you could have simply downloaded a rom, boot in recovery, use "adb push" to copy the file on your phone, then install it normally through your recovery.

abaaaabbbb63 said:
How did the command "fastboot system" even work?
When you flash an image, the command is the following:
Fastboot flash boot boot.img
Fastboot flash system system.img
Fastboot flash userdata userdata.img
Etc.
Anyways, you could have simply downloaded a rom, boot in recovery, use "adb push" to copy the file on your phone, then install it normally through your recovery.
Click to expand...
Click to collapse
Sorry, I typed incorrectly. Yes, I did fastboot flash system system.img, etc.

ddb540 said:
Thank you for the response. Was able to push the jwr66y image to the device using adb in recovery mode. Then, did the following:
fastboot boot boot.imdg
fastboot system jwr66y.imdg
fastboot erase userdata
fastboot erase cache
fastboot reboot
Now device is stuck in boot loop. Suggestions?
Thanks!
Click to expand...
Click to collapse
Try to go into recovery and wipe the caches and do a data factory reset, that will probably work.

Convert a tar.md5 file to .img
gee2012 said:
Try to go into recovery and wipe the caches and do a data factory reset, that will probably work.
Click to expand...
Click to collapse
Most flashable files come as a tar.md5 for use with odin. What do you do with a tar.md5 file if you want to flash it with adb? It appears that adb requires .img files.
My reason for wanting an .img file is that I tried flashing a stock recovery with odin and got an "MD5 Error, Binary is invalid". I have no idea what that means. I just figured I would try the adb approach since I need to learn adb anyway.
I would rather solve the "MD5 Error, Binary is invalid" error and proceed with odin. Since I am a noob, I don't know exactly how to proceed. Can anyone help me resolve this?
Thanks,

AHLASSICH said:
Most flashable files come as a tar.md5 for use with odin. What do you do with a tar.md5 file if you want to flash it with adb? It appears that adb requires .img files.
My reason for wanting an .img file is that I tried flashing a stock recovery with odin and got an "MD5 Error, Binary is invalid". I have no idea what that means. I just figured I would try the adb approach since I need to learn adb anyway.
I would rather solve the "MD5 Error, Binary is invalid" error and proceed with odin. Since I am a noob, I don't know exactly how to proceed. Can anyone help me resolve this?
Thanks,
Click to expand...
Click to collapse
Odin? That's for samsung mate. Won't work here. You need to download the factory images and extract it to get stock recovery. Or just head over to general section and there are thread for flashable stock recovery/modem/kernel. There is also a guide on how to use adb, a very detailed one at that. I'm sure you won't have trouble following it. Just read carefully and do it. All the things you need are given in that thread.
Edit: Guide - http://forum.xda-developers.com/showthread.php?t=2010312

AHLASSICH said:
Most flashable files come as a tar.md5 for use with odin. What do you do with a tar.md5 file if you want to flash it with adb? It appears that adb requires .img files.
My reason for wanting an .img file is that I tried flashing a stock recovery with odin and got an "MD5 Error, Binary is invalid". I have no idea what that means. I just figured I would try the adb approach since I need to learn adb anyway.
I would rather solve the "MD5 Error, Binary is invalid" error and proceed with odin. Since I am a noob, I don't know exactly how to proceed. Can anyone help me resolve this?
Thanks,
Click to expand...
Click to collapse
1. Make sure you have Android SDK installed. if not download here.
2. Download Nexus 4 factory rom from here.
3. Unzip the factory rom [occam-kot49h-factory]. If you dont know how to unzip. Download and install Winrar. Open the file with Winrar and Extract it somewhere in your computer.
4. Turn off your phone
3. Hold Volume up + Power; once it loads up to bootloader; connect it to your computer
5. The file [occam-kot49h-factory] you extract it early; in there you should see a file flash-all-bat. Open it [run it as admin if you are running Vista/7/8] and let it do its magic. Your phone will factory reset.

http://www.wugfresh.com/nrt/
go to this website, download the toolkit, and connect your nexus to computer on fastboot mode, do some few clicks, and boom, done

Related

Deleted build prop and rebooted, HELP

I accidentally delted build.prop and rebooted. Dont ask me how, just know that my device was running 4.1.1 and was rooted, but did not have clockwork recovery. PLEASE HELP IMMA CRY!!!
https://developers.google.com/android/nexus/images#nakasi
Im a total noob please tell me how to flash the factory image
Raja101 said:
I accidentally delted build.prop and rebooted. Dont ask me how, just know that my device was running 4.1.1 and was rooted, but did not have clockwork recovery. PLEASE HELP IMMA CRY!!!
Click to expand...
Click to collapse
Here's the build prop. Maybe you could find a way to push it to the right folder from your PC. Don't forget to remove text extension and put prop.
kieso said:
Here's the build prop. Maybe you could find a way to push it to the right folder from your PC. Don't forget to remove text extension and put prop.
Click to expand...
Click to collapse
My computer will not recognize my nexus 7 PLease help im crying :'(
http://forum.xda-developers.com/showthread.php?t=1781250
Make sure you have working ADB / drivers installed
Flash a stock image, get PDAnet drivers and then use wugs toolkit to flash stock build.prop doesn't touch boot loader so should be good to go
Sent from my Nexus 7 using xda app-developers app
1. Download faslboot/adb drivers
2. Download the stock image for "nakasi" here: https://developers.google.com/android/nexus/images#nakasi
3. Untar the stock image so you get a few files and a zip file
4. Boot into the device's bootloader (hold the power button + up and down on the volume rocker)
4. CD to the folder where you extracted the stuff to and run these commands:
Code:
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot erase userdata
fastboot flash bootloader bootloader-grouper-3.34.img
fastboot reboot-bootloader
<wait for device to reboot back into the bootloader>
Code:
fastboot -w update image-nakasi-jro03d.zip
After those commands you should have returned completely to stock.
Thanks for all the help! I was able to download the factory image and flash it using the nexus toolkit. But again thanks for all the replies and help.
Good you got your device functional but now you see why it's important to have cwm/twrp installed as you could have saved yourself the hassle of fastbooting back and starting from scratch.

[Q] Nexus 7 2012 -- Recovery won't flash - Please help!

Good morning,
I followed the tutorial here on XDA on how to basically factory reset my Nexus 7. Unfortunately, while going through all the steps I also deleted my recovery. Now I am unable to flash any recovery back on my device. I have tried flashing Clockwork, TWRP and even Google Stock recovery, but it won't work. Neither flashing via Nexus 7 toolkit nor by hand was successful, instead it always returns the following error message:
Booting into Android using an Insecure Boot Image..
cannot load "root\boot-insecure-.img' : No error
Now my Nexus 7 is in some random state, since Android 4.2.2 is installed, but rooting via the Toolkit returns the same message when it comes to the point of flashing a recovery. Then it simply skips the remaining steps and does not install the superuser app. I also downloaded and tried using the ROM Manager, but since root-access is missing, it can't do anything either.
Do you guys have any solution to this?
Help is very much appreciated!
Thanks!
marcfeld said:
Good morning,
I followed the tutorial here on XDA on how to basically factory reset my Nexus 7. Unfortunately, while going through all the steps I also deleted my recovery. Now I am unable to flash any recovery back on my device. I have tried flashing Clockwork, TWRP and even Google Stock recovery, but it won't work. Neither flashing via Nexus 7 toolkit nor by hand was successful, instead it always returns the following error message:
Booting into Android using an Insecure Boot Image..
cannot load "root\boot-insecure-.img' : No error
Now my Nexus 7 is in some random state, since Android 4.2.2 is installed, but rooting via the Toolkit returns the same message when it comes to the point of flashing a recovery. Then it simply skips the remaining steps and does not install the superuser app. I also downloaded and tried using the ROM Manager, but since root-access is missing, it can't do anything either.
Do you guys have any solution to this?
Help is very much appreciated!
Thanks!
Click to expand...
Click to collapse
Though toolkits save a lot of time, I always prefer to do stuff the manual way and I suggest you do the same. To flash the recovery do the following steps
1) a) if you are running Windows open cmd as administrator and CD into a folder containing adb and fastboot .exes
b) copy paste a downloaded recovery image in the same folder and rename it to recovery.img for simplicity.
2) boot into boot loader by pressing power volume down and volume up all together after the device is turned off
3) in bootloader enter the fastboot mode and in cmd on PC type
Code:
fastboot devices
At this moment your device should turn up in the command prompt.if it doesn't then try installing the Asus drivers and repeat the steps above carefully.
4) once all that is over type
Code:
fastboot flash recovery recovery.img
And then the recovery must be flashed . you will get an output on cmd with the time taken to flash it too .
Then reboot into recovery and enjoy.
A succinct summary, Red Devil.
I always maintain, on a my Windows laptop, a folder called FastBootAdb, that contains the following files...
fastboot.exe
adb.exe
AdbWinApi.dll (needed by Windows)
AdbWinUsbApi.dll (needed by Windows)
If I wish to flash a new recovery.img (or a new boot.img - useful for certain kernels, that consists of nothing but a boot.img, like franco for example. Most custom kernels though, consist of more than just a boot.img, and need to flashed via TWRP or CWM, and can't just be fastboot flashed).
Anyway... I just copy the new recovery into this folder, rename it to recovery.img and run the fastboot command accordingly...
Code:
fastboot flash recovery recovery.img
...similarly with the boot partition...
Code:
fastboot flash boot boot.img
To be honest, I'm puzzled why people feel the need to overcomplicate this very simple procedure with toolkits.
Rgrds,
Ged.
Thanks a million guys!
I will try this as soon as I get home tonight and let you know.
nourtsW escape
This did the trick!
Thanks again guys!
marcfeld said:
This did the trick!
Thanks again guys!
Click to expand...
Click to collapse
Glad you got it sorted.
With Android, there's always 'more than one way to skin a cat!'.
Rgrds,
Ged.
GedBlake said:
Glad you got it sorted.
With Android, there's always 'more than one way to skin a cat!'.
Rgrds,
Ged.
Click to expand...
Click to collapse
I am so relieved, because I thought I had bricked it...
GedBlake said:
A succinct summary, Red Devil.
I always maintain, on a my Windows laptop, a folder called FastBootAdb, that contains the following files...
fastboot.exe
adb.exe
AdbWinApi.dll (needed by Windows)
AdbWinUsbApi.dll (needed by Windows)
If I wish to flash a new recovery.img (or a new boot.img - useful for certain kernels, that consists of nothing but a boot.img, like franco for example. Most custom kernels though, consist of more than just a boot.img, and need to flashed via TWRP or CWM, and can't just be fastboot flashed).
Anyway... I just copy the new recovery into this folder, rename it to recovery.img and run the fastboot command accordingly...
Code:
fastboot flash recovery recovery.img
...similarly with the boot partition...
Code:
fastboot flash boot boot.img
To be honest, I'm puzzled why people feel the need to overcomplicate this very simple procedure with toolkits.
Rgrds,
Ged.
Click to expand...
Click to collapse
ive done this exactly step by step and i getthe system cannot find the specified path i made a folder inside the windows folder i named it recovery in the command prompt i did cd windows then cd recovery then i typed fastboot devicesthen it said that
Help! Nexus 7 won't accept recovery flash image
I've tried all the above. I can get to the command prompt, and fastboot devices sees my device. I input the above commands to reflash, it starts with message "sending 'recovery' <xxx.xkb>' then nothing. It just sits there until I reset or reboot my nexus 7. Can anyone help?

unable to load from fastboot

I am trying to flash the kernal for 5.1.1 after a restore to stock and get my wifi going again. I placed the kernal zip in the adb folder
where I have the adb and fastboot exe files. I opened the command prompt in that folder after I unziped the kernal to get the img.
I can fastboot reboot bootloader, and fastboot devices, which shows the s.n for the phone. When I used the, fastboot flash boot v4tk-kernel-uber-alias.img, command I get an "unable to load"? Whats going on and how do I fix this. Same thing happened when I tried to flash non-hlos.bin. Help please....I am using windows 10.
Garyalp said:
I am trying to flash the kernal for 5.1.1 after a restore to stock and get my wifi going again. I placed the kernal zip in the adb folder
where I have the adb and fastboot exe files. I opened the command prompt in that folder after I unziped the kernal to get the img.
I can fastboot reboot bootloader, and fastboot devices, which shows the s.n for the phone. When I used the, fastboot flash boot v4tk-kernel-uber-alias.img, command I get an "unable to load"? Whats going on and how do I fix this. Same thing happened when I tried to flash non-hlos.bin. Help please....I am using windows 10.
Click to expand...
Click to collapse
Somebody? Im sure Im not the only one with this problem.....
Flashing boot and modem are pretty straight forward. Not sure what your issue is.
Garyalp said:
I am trying to flash the kernal for 5.1.1 after a restore to stock and get my wifi going again. I placed the kernal zip in the adb folder
where I have the adb and fastboot exe files. I opened the command prompt in that folder after I unziped the kernal to get the img.
I can fastboot reboot bootloader, and fastboot devices, which shows the s.n for the phone. When I used the, fastboot flash boot v4tk-kernel-uber-alias.img, command I get an "unable to load"? Whats going on and how do I fix this. Same thing happened when I tried to flash non-hlos.bin. Help please....I am using windows 10.
Click to expand...
Click to collapse
The only things I can think of that would cause that would be either the file is not in that directory or it's not spelled correctly. For the modem are you typing non-hlos or NON-HLOS? It should be all caps. As for the boot image, try renaming it. That's about all I can think of.
Sent from my XT1575 using XDA-Developers mobile app

[Q][Help] Nexus 4 stuck in bootloop Recovery after flashing twrp to boot

Hi,
I made this post/thread because i couldn't find a solution to my problem through this forum and google.
Here is my trouble:
I was trying to install a twrp recovery and was following the instructions of a tutorial.
-So first i installed flashify and proceeded to a back up of the current kernel and current recovery
-Then downloaded a custom recovery image through TWRP release for my nexus 4
-After this i accidentally flashed the recovery image to boot instead of recovery
Now as you can guess the trouble is that my phone only boots to TWRP recovery instead of usual boot.
I tried to find aswers on this forum and google and yet i didn't find a solution.
I tried this post but without results:
http://forum.xda-developers.com/tmobile-lg-g3/general/fix-recovery-loop-twrp-computer-t2873386
I would be grateful for any help and wish to recover this mistake without using a factory reset if possible.
Thank you, as you can see i am pretty new to this environment.
Can you get into fastboot mode? If yes, try flashing a stock Google rom and perform a factory wipe after installing the stock rom.
audit13 said:
Can you get into fastboot mode? If yes, try flashing a stock Google rom and perform a factory wipe after installing the stock rom.
Click to expand...
Click to collapse
Thank you for your answer, yes i can get into fastboost mode. As i am pretty new can you explain me how i can flash the stock Google rom (i guess it is the factory rom provided ?). Will this operation erase my data on the phone ?
Boot into fastboot and flash boot.img and recovery.img file from stock rom. Make sure you use the stock rom that matches the rom currently installed on your phone.
Ilovkos said:
Thank you for your answer, yes i can get into fastboost mode. As i am pretty new can you explain me how i can flash the stock Google rom (i guess it is the factory rom provided ?). Will this operation erase my data on the phone ?
Click to expand...
Click to collapse
Once in fastboot, extract the downloaded zip you got from Google. There you will find flash-all.bat Execute it as admin and wait. If it doesn't work, then extract the zip within the first zip and you should get loads of .img files. You will manually have to flash them. The commands are a bit different for each partition. They go like this:
Code:
fastboot flash system system.img
fastboot flash recovery recovery. img
fastboot flash cache cache.img
fastboot flash boot boot.img
fastboot flash data userdata.img
Note that if your cmd/terminal isn't open from the directory where the files are you will have to input it's location, for example
Code:
fastboot flash recovery C:\Users\YOURUSER\Desktop\recovery.img
Also note that there must be no spaces neither in the file name or the directories where the file is located, otherwise it probably won't flash.
Also yes, doing this will completely revert you to stock, and you WILL loose all your data. You could try just reflashing recovery.img and then flashing TWRP over it. If you can get to TWRP after this, then connect the USB cable to your PC and transfer all the data you need, after which I recommend flashing to stock. You can root and/or flash custom ROMs after this.
However in your case I think you don't have to completely go back to stock. Just try flashing the proper boot and recovery images over fastboot like I explained above and try booting then.
nerotNS said:
Once in fastboot, extract the downloaded zip you got from Google. There you will find flash-all.bat Execute it as admin and wait. If it doesn't work, then extract the zip within the first zip and you should get loads of .img files. You will manually have to flash them. The commands are a bit different for each partition. They go like this:
Code:
fastboot flash system system.img
fastboot flash recovery recovery. img
fastboot flash cache cache.img
fastboot flash boot boot.img
fastboot flash data userdata.img
Note that if your cmd/terminal isn't open from the directory where the files are you will have to input it's location, for example
Code:
fastboot flash recovery C:\Users\YOURUSER\Desktop\recovery.img
Also note that there must be no spaces neither in the file name or the directories where the file is located, otherwise it probably won't flash.
Also yes, doing this will completely revert you to stock, and you WILL loose all your data. You could try just reflashing recovery.img and then flashing TWRP over it. If you can get to TWRP after this, then connect the USB cable to your PC and transfer all the data you need, after which I recommend flashing to stock. You can root and/or flash custom ROMs after this.
However in your case I think you don't have to completely go back to stock. Just try flashing the proper boot and recovery images over fastboot like I explained above and try booting then.
Click to expand...
Click to collapse
Thanks to both of you I managed to fix this just by flashing the boot.img of the Google factory img. It didn't erase my data except my messages which is nice.

Stuck loading twrp

Hi,
When my S7 Edge boots up it jumps to twrp but it's stuck on the teamwin logo screen and does not advance to menu.
This happened after I tried to format the data partition to ext4 via twrp and it just got stuck there too so when I rebooted it landed in this situation.
Unfortunately reflashing twrp or reflashing the stock rom via ODIN does not work as COM3 is recognized but then when I press start it doesnt do anything....
Also tried the suggestion I read online of:
fastboot format cache
fastboot format userdata
These commands just get stuck on <waiting for device>.
Also tried adb shell recovery --wipe_data but it gets stuck at I:LANG: en
Any help will be much appreciated!
Thanks
This is how I solved it in the end.
With cable connected I did:
1. adb push boot.img /external_sd
2. adb shell
3. dd if=/external_sd/boot.img of=/dev/block/platform/155a0000.ufs/by-name/RECOVERY
4. fastboot format cache
5. fastboot format userdata
6. adb shell recovery --wipe_data
7. adb fastboot recovery
Notes:
The boot.img was obtained from a downloaded stock rom image and by decompressing the AP file (just open it with 7Zip) and then you need to uncompress boot.img.lz4 with 7zip zstandard (look it up)
Step 1 took sometime to run since TWRP was stuck loading using a lot of CPU as phone was really really hot!
Sometime I needed to do a adb fastboot recovery and then quickly run and rerun command in step 1 until it succeeded.
Step 6 is redundant but is there just to be safe.
After this you are booted back to a stock recovery where you can use Odin to flash what you want.
In my case I flashed a stock rom and then flashed TWRP again.
redirts1978 said:
Hi,
When my S7 Edge boots up it jumps to twrp but it's stuck on the teamwin logo screen and does not advance to menu.
This happened after I tried to format the data partition to ext4 via twrp and it just got stuck there too so when I rebooted it landed in this situation.
Unfortunately reflashing twrp or reflashing the stock rom via ODIN does not work as COM3 is recognized but then when I press start it doesnt do anything....
Also tried the suggestion I read online of:
fastboot format cache
fastboot format userdata
These commands just get stuck on <waiting for device>.
Also tried adb shell recovery --wipe_data but it gets stuck at I:LANG: en
Any help will be much appreciated!
Thanks
Click to expand...
Click to collapse
HELP!!!! cant get my phone to be recogniced by adb, I have the same problem,
if its on TWRP boot screen or RECOVERY (blue downloading.... screen) its the same!!!
please help
redirts1978 said:
This is how I solved it in the end.
With cable connected I did:
1. adb push boot.img /external_sd
2. adb shell
3. dd if=/external_sd/boot.img of=/dev/block/platform/155a0000.ufs/by-name/RECOVERY
4. fastboot format cache
5. fastboot format userdata
6. adb shell recovery --wipe_data
7. adb fastboot recovery
Notes:
The boot.img was obtained from a downloaded stock rom image and by decompressing the AP file (just open it with 7Zip) and then you need to uncompress boot.img.lz4 with 7zip zstandard (look it up)
Step 1 took sometime to run since TWRP was stuck loading using a lot of CPU as phone was really really hot!
Sometime I needed to do a adb fastboot recovery and then quickly run and rerun command in step 1 until it succeeded.
Step 6 is redundant but is there just to be safe.
After this you are booted back to a stock recovery where you can use Odin to flash what you want.
In my case I flashed a stock rom and then flashed TWRP again.
Click to expand...
Click to collapse
i have exactly the same problem but cant boot to twrp or to OS ...only download mode...tried to flash twrp again not worked now try to flash stock firmware via odin ....PLEASE HELP ME
Kackwuerstchen said:
i have exactly the same problem but cant boot to twrp or to OS ...only download mode...tried to flash twrp again not worked now try to flash stock firmware via odin ....PLEASE HELP ME
Click to expand...
Click to collapse
I don't know what are you doing wrong but when I was stuck in this situation, I flashed stock firmware from sammobile and it fixed the problem.
Make sure you downloaded correct firmware.
Hi,
I know, its quite long time you solved this, but in which mode should be phone to use adb commands?
redirts1978 said:
This is how I solved it in the end.
With cable connected I did:
1. adb push boot.img /external_sd
2. adb shell
3. dd if=/external_sd/boot.img of=/dev/block/platform/155a0000.ufs/by-name/RECOVERY
4. fastboot format cache
5. fastboot format userdata
6. adb shell recovery --wipe_data
7. adb fastboot recovery
Notes:
The boot.img was obtained from a downloaded stock rom image and by decompressing the AP file (just open it with 7Zip) and then you need to uncompress boot.img.lz4 with 7zip zstandard (look it up)
Step 1 took sometime to run since TWRP was stuck loading using a lot of CPU as phone was really really hot!
Sometime I needed to do a adb fastboot recovery and then quickly run and rerun command in step 1 until it succeeded.
Step 6 is redundant but is there just to be safe.
After this you are booted back to a stock recovery where you can use Odin to flash what you want.
In my case I flashed a stock rom and then flashed TWRP again.
Click to expand...
Click to collapse
dankovac1999 said:
Hi,
I know, its quite long time you solved this, but in which mode should be phone to use adb commands?
Click to expand...
Click to collapse
Same problem and question here

Categories

Resources