- Forum
- Google Hardware, Services & Apps
- More Google Devices & Services
- Google Nexus 4
- Nexus 4 Rooting, ROMs, & Hacks
[GUIDE] Nexus 4 - Factory Image Restore
- [TITLE=Nexus 4 Factory Image Restore]
[TAB=Intro]Hit a wall while hacking away on your unlocked Nexus 4? Don't Panic!! Whether you think you bricked your device, desire a clean slate to start over, or just want to play with some fastboot commands.. Nexus devices are the recipients of full Factory Images straight from Google, ensuring that we can recover from even the ugliest of situations and restore our device to brand new, out-of-the-box condition at any time. You will need a few files and a little familiarity with entering commands in a terminal / command prompt, but mostly just the ability to read and follow instructions. It's so easy, your grandma could do it! [WARN]Restoring the Factory Images will wipe EVERYTHING on your device, including the internal sdcard partition. If you can boot it up at all right now, you may wish to copy your photos, music, etc to your computer before we begin, else they will be lost. We are not responsible for your device and anything you do to it, but we will do our best to help[/WARN][/TAB][TAB=Setup and Files]A few items you will need before we begin..
1. Factory Image The latest Factory Image for your device -- 4.3 (JWR66V) -- direct download link from Google: https://dl.google.com/dl/android/aos...y-08d2b697.tgz
A link to the page where you can find the files yourself, if for some reason the direct link is not working: https://developers.google.com/android/nexus/images
Please check the md5 checksum after downloading. If you get anything other than: 9d33973a61fa9266244fc43397888703 -- you should redownload. If you don't know how to check an md5 on your operating system, Google it!
2. ADB and fastboot files Unless you used some kind of toolkit when you originally unlocked/rooted your device, you should have these already. They may be located in your Android SDK /platform-tools directory if you have that installed, or wherever you downloaded them to before. Make sure you know where they are. If you need to grab them again, I totally stole these from smarter people than me (namely PaulOBrien) and just took out stuff we don't need, and renamed it to avoid confusion for you guys. Download from here: https://dl.dropbox.com/u/47300967/ne...b-fastboot.zip
*Mac users: Some Mac users have reported freeze-ups and other issues when the process gets to sending the system.img over to the device. AC users bshimrak and andr0idralphie were able to solve this by using updated adb and fastboot files, and bshimrak was kind enough to provide me those files, which I am mirroring here: https://dl.dropboxusercontent.com/u/...ndroid-MAC.zip
Mac users may need to use these adb and fastboot files. The steps should remain the same.
3. Drivers If you are on a Windows system (linux and mac need not bother with these): Universal Naked Driver 0.72.zip
Warning: Uninstall any previous driver package's you may have installed and also manually remove drivers by attaching your phone and going to Windows device manager and right click the entry for your phone and select "Uninstall" on the next prompt make sure to select "Delete the driver software for this device" then hit OK and reboot before installing these drivers
HUGE thanks to 1wayjonny at xda for these drivers!
[/TAB][TAB=Step-by-Step]Are you still with me? Great... let's get started!
Here are the GENERAL INSTRUCTIONS TO RESTORE THE STOCK IMAGES. Make sure you know how to do it for your computer/setup and that ADB and fastboot is set up on your computer. Know the exact folder containing the fastboot files you will be using.
[NOTE]Throughout these instructions I will be entering our commands in the format:
Code:fastboot … … …
For Windows this should look like:
Code:fastboot-windows … … …
Code:sudo fastboot-linux … … …
Code:./fastboot-mac … … …
[INFO]1. Extract the files from the Factory Image we downloaded from Google. The BEST app you can use for this is 7zip. I suggest Googling it and finding a version for your OS. Using other file archive apps (i.e. winrar, winzip, etc) may result in errors. Dive through the folders and you will find a number of files we are going to fastboot to your device. We want to place all of these files into the directory we located earlier which contains our "fastboot" file. Move or copy them over to that folder.
2. Open a command prompt inside the folder we have set up our files in. On Windows this can be done by holding shift as you right-click in the folder, then select "Open command window here". On Mac or on a Linux system you want to open a terminal/command prompt and navigate to that folder using "cd" or "change directory" commands. For example, if you grabbed the zip I posted earlier and extracted it on your desktop, your folder is called "nexus4-adb-fastboot" on your desktop, and you would enter:
Code:cd desktop cd nexus4-adb-fastboot
3. Boot into the bootloader/fastboot mode. Power down the phone, then hold Volume Down and Power until you see the familiar green robot, and a string of text on the left that begins with "fastboot mode" in red letters. You may also get here if your phone is powered on and plugged into the computer already by simply typing
Code:fastboot reboot bootloader
4. Let's make sure fastboot is recognizing your device. Type this command and hit Enter:
Code:fastboot devices
5. This first command is going to wipe all your old EVERYTHING from the device. This step isn't always needed, but it's a great idea to do it anyway. The code we use later to flash the Factory Image will also wipe it, but you may sometimes avoid bugs by doing it manually first. Type each of these lines followed by Enter between them, waiting for one to finish before moving on to the next:
Code:fastboot erase boot fastboot erase cache fastboot erase recovery fastboot erase system fastboot erase userdata
Code:fastboot flash bootloader bootloader-mako-makoz20i.img fastboot reboot-bootloader fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.84.img fastboot reboot-bootloader fastboot –w update image-occam-jwr66v.zip
7. If you intend to keep your device unlocked and get back to playing with it, then you are done! Have fun! However, if you would like to re-lock your bootloader now that you have a stock device again, simply reboot into the bootloader just like we did earlier. In the command prompt type:
Code:fastboot oem lock fastboot reboot-bootloader
Code:fastboot oem unlock
stoleborrowed files and verbatim for this guide
Happy fastbooting![/INFO]
[/TAB][TAB=Troubleshooting]Answers and Solutions to Common Issues
Q. When entering the commands I see the error "fastboot is not a recognized command"
A. Your command prompt just isn't looking in the correct location. Remember you had to locate the directory which contains your fastboot file, move all of the files extracted from the Factory Image to that directory, and then either tell the command prompt to look in that directory or open the command window from within that directory. Go back to Step 2 of the step-by-step and try again.
Q. Everything seemed to work.. but when I was flashing the image I saw these (or similar) messages:
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
A. Safe to ignore these.
Q. After the process completes I am getting stuck at the Android X or boot logo and cannot get past it.
A. Boot back into the bootloader and try locking and then unlocking it, simply using:
fastboot oem lock
followed by
fastboot oem unlock
And accept it on the phone. Sometimes the wipe this does is needed to fully clear the old data and caches.
Q. I got an error saying "FAILED (command write failed (Unknown error))"
A. Try using a different USB port. It's usually best, if possible, to use one in the back of your computer rather than the front.
Q. Message indicates the fastboot command is not in the correct syntax.. or I got an error sending the system portion.. or it seemed to freeze when sending system and won't boot up now.
A. Besides trying a different USB port, also try entering the final command switching up the "-w" portion to follow the "update" command, as in:
fastboot update –w image-occam-jop40d.zip
Q. I got an error saying "FAILED (remote: (BadParameter))"
A. Your computer did not like flashing the last file, the big .zip containing the various parts of your system (specifically the boot, system, recovery, and userdata sections). Unzip that file, and make sure to move the extracted files once again to the same directory as your fastboot file. Now you are going to flash each of them one at a time, as in:
Code:fastboot flash boot boot.img fastboot flash system system.img fastboot flash recovery recovery.img fastboot flash userdata userdata.img
[/TAB]
[/TITLE]11-11-2012 10:19 AMLike 93 -
-
Edit: So far it's not working. It's still stuck on the bootscreen.
Edit 2: I used the Nexus 4 Toolkit and it worked. I have no idea why and what the difference was. I followed the directions down to the .img and nothing worked.peteisaacs likes this.11-23-2012 02:23 PMLike 1 - Housekeeping... updated link and instructions to reflect the new 4.2.1 (JOP40D) factory image.
Lol what's a guy gotta do to get stickied around here? Who's asleep at the wheel AC?NotJustAPhone and zero neck like this.11-29-2012 07:41 PMLike 2 - 12-02-2012 02:22 PMLike 3
-
- Remember that safe full of money Scrooge McDuck would swim around in? Lol..
Sent from my Nexus 4 using Tapatalk 2NotJustAPhone and zero neck like this.12-02-2012 07:34 PMLike 2 - mzanetteZeeFriend of mine did a factory reset on his Nexus 4, and now he doesn't have the Emoji keyboard as an option any longer. On my Nexus it's called iWnn IME under language and input. I've found a .zip file on XDA that contains this keyboard, but I'm just curious as to how I go about installing it. Do I flash the entire .zip file through the fastboot/command line option, or can I take the iWnn IME.apk that I find inside the zip file and install that as a regular app? Anyone know?12-06-2012 02:14 PMLike 0
- Friend of mine did a factory reset on his Nexus 4, and now he doesn't have the Emoji keyboard as an option any longer. On my Nexus it's called iWnn IME under language and input. I've found a .zip file on XDA that contains this keyboard, but I'm just curious as to how I go about installing it. Do I flash the entire .zip file through the fastboot/command line option, or can I take the iWnn IME.apk that I find inside the zip file and install that as a regular app? Anyone know?
In terms of the zip you found, you would want to flash it using a custom recovery. You can boot into TWRP temporarily for that purpose, just follow the steps in the Root It! tab in my Unlock guide, and flash that zip instead of the SuperSU one.
Sent from my Nexus 4 using Tapatalk 212-06-2012 04:17 PMLike 0 - mzanetteZeeIf it was a part of stock, it should have been included when he correctly flashed the factory image.
In terms of the zip you found, you would want to flash it using a custom recovery. You can boot into TWRP temporarily for that purpose, just follow the steps in the Root It! tab in my Unlock guide, and flash that zip instead of the SuperSU one.
Sent from my Nexus 4 using Tapatalk 212-07-2012 09:04 AMLike 0 - HELP....NO IDEA WHAT TO DO
I followed the instruction, all successful, until I input "./fastboot-mac -w update image-occam-jop40d.zip"
- 1st try,
Code:checking product... OKAY checking version-bootloader... OKAY checking version-baseband... OKAY sending 'boot' (6166 KB)... OKAY writing 'boot'... OKAY sending 'recovery' (6664 KB)... OKAY writing 'recovery'... OKAY sending 'system' (531285 KB)... ERROR: usb_write failed with status e00002be FAILED (data transfer failure (No such file or directory))
Code:archive does not contain 'boot.sig' archive does not contain 'recovery.sig' archive does not contain 'system.sig' --------------------------------------------
12-09-2012 05:14 AMLike 0 - HELP....NO IDEA WHAT TO DO
I followed the instruction, all successful, until I input "./fastboot-mac -w update image-occam-jop40d.zip"
- 1st try,
Code:checking product... OKAY checking version-bootloader... OKAY checking version-baseband... OKAY sending 'boot' (6166 KB)... OKAY writing 'boot'... OKAY sending 'recovery' (6664 KB)... OKAY writing 'recovery'... OKAY sending 'system' (531285 KB)... ERROR: usb_write failed with status e00002be FAILED (data transfer failure (No such file or directory))
Code:archive does not contain 'boot.sig' archive does not contain 'recovery.sig' archive does not contain 'system.sig' --------------------------------------------
Sent from my Nexus 4 using Tapatalk 212-09-2012 08:23 AMLike 0 - Thank you so much for the guide. Everything seems to be working well, except I got the three boot, recovery, and system.sig errors. When my Nexus 4 reboots, it seems fine until it gets to the "X" splashcreen. It has now been stuck at this point for about 45 minutes. I have tried going through the entire process multiple times now, and have downloaded the stock file multiple times as well. It won't boot either plugged in or unplugged via usb.
Someone help.... Please???Marwan Alani likes this.12-10-2012 02:36 PMLike 1 - Thank you so much for the guide. Everything seems to be working well, except I got the three boot, recovery, and system.sig errors. When my Nexus 4 reboots, it seems fine until it gets to the "X" splashcreen. It has now been stuck at this point for about 45 minutes. I have tried going through the entire process multiple times now, and have downloaded the stock file multiple times as well. It won't boot either plugged in or unplugged via usb.
Someone help.... Please???
Sent from my Nexus 4 using Tapatalk 212-10-2012 03:33 PMLike 0 -
Thank you so much!12-10-2012 04:01 PMLike 0 - Thanks for the quick reply. I have tried that a few times thinking that may be the case. However, unplugged or plugged in, it just won't get past the splash screen. Is there a possibility to side load the stock from from Android recovery? I have seemingly gotten to that screen, but I just have no idea what to do there. Again, any help would be great!
Thank you so much!
Sent from my Nexus 4 using Tapatalk 212-10-2012 04:11 PMLike 0 -
Just wiped cache and it insta-rebooted. Looking like it is now just stuck on the Nexus X again... Hoping something can be done still....
How about the custom rom idea? Is there any use in trying to load CM10?12-10-2012 04:22 PMLike 0 -
You'll have to adb push them to your phone while in recovery. Same can be done with the CM10 ROMs, just saying what I currently recommend
Sent from my Nexus 4 using Tapatalk 212-10-2012 04:34 PMLike 0
- Forum
- Google Hardware, Services & Apps
- More Google Devices & Services
- Google Nexus 4
- Nexus 4 Rooting, ROMs, & Hacks
[GUIDE] Nexus 4 - Factory Image Restore
Similar Threads
-
[GUIDE] Nexus 7 - Factory Image Restore
By 2defmouze in forum Google Nexus 7 (2012) Rooting, ROMs, & HacksReplies: 439Last Post: 12-02-2016, 05:37 AM -
[GUIDE] Return to Stock: Factory Images for the VZW Galaxy Nexus
By dmmarck in forum Verizon Galaxy Nexus Rooting, ROM's, and Hack'sReplies: 110Last Post: 03-31-2013, 01:08 PM -
Factory Image(JB) for Nexus S and Galaxy Nexus Posted
By still1 in forum Legacy Android & Other OS'sReplies: 6Last Post: 07-29-2012, 03:11 PM
LINK TO POST COPIED TO CLIPBOARD