[GUIDE] Nexus 4 - Factory Image Restore

I love you man! I really do! Just to add, since some of the files required are not available and I did some googling to find them..

Factory image - Nexus 4 Firmware – occam | Random Phantasmagoria
Universal naked driver - [ADB/FB/APX Driver] Universal Naked Driver 0.72 - xda-developers
Setup ADB and fastboot - How to Set Up ADB / Fastboot with Android SDK for Any Andorid Device

That's all! This totally worked at un-bricking my phone after I tried a hard reset through the bootloader. Once again, many thanks!
 
I love you man! I really do! Just to add, since some of the files required are not available and I did some googling to find them..

Factory image - Nexus 4 Firmware ? occam | Random Phantasmagoria
Universal naked driver - [ADB/FB/APX Driver] Universal Naked Driver 0.72 - xda-developers
Setup ADB and fastboot - How to Set Up ADB / Fastboot with Android SDK for Any Andorid Device

That's all! This totally worked at un-bricking my phone after I tried a hard reset through the bootloader. Once again, many thanks!

Both of those files are in the OP, under the Setup and Files tab :)
 
HELP! i keep getting this >>> error: failed to load 'image-oocam-jop40d.zip' when i put in the command ./fastboot-mac -w update image-oocam-jop40d.zip. dont know what to do
 
HELP! i keep getting this >>> error: failed to load 'image-oocam-jop40d.zip' when i put in the command ./fastboot-mac -w update image-oocam-jop40d.zip. dont know what to do

Prior fastboot commands all worked without a hitch? Try a different, preferably rear, usb port..
 
yup everything other fastboot command worked except that one, and i have a macbook so theres only 2 usb ports on the side
 
yup everything other fastboot command worked except that one, and i have a macbook so theres only 2 usb ports on the side

Check that you're spelling the name correctly in the command line, has to be exactly right. I notice you misspelled "occam" in the part you quoted above...
 
Heres what i did & if you notice i added flash to the command as well as took the -w out and thats the only way it proceeded to work but then i get the
failed message. why is that??
MacBook-Pro:nexus4-adb-fastboot jerel$ ./fastboot-mac flash update image-occam-jop40d.zip
sending 'update' (314357 KB)... OKAY
writing 'update'... FAILED (remote: partition table doesn't exist)
 
Heres what i did & if you notice i added flash to the command as well as took the -w out and thats the only way it proceeded to work but then i get the
failed message. why is that??
MacBook-Pro:nexus4-adb-fastboot jerel$ ./fastboot-mac flash update image-occam-jop40d.zip
sending 'update' (314357 KB)... OKAY
writing 'update'... FAILED (remote: partition table doesn't exist)

Not sure why you had to change the command, but the way I wrote it is the exact way it needs to be entered. Try again using the right command.. Is it possible you've got another computer you can use? I don't know Macs at all.. I know this sounds difficult but maybe can you try live booting Ubuntu to get it done? You can download an image to use on a usb stick from Home | Ubuntu, simply boot into ubuntu without actually installing it or changing your computer at all and try and get everything done within that os..

Else I would keep trying on the mac os using the right command. You could potentially try unpacking the factory image and sending the individual pieces of it one at a time, I believe I've noted that method in the troubleshooting tab.
 
ok. i think my problem now is the missing partition table. i think its not writing because their is nothing to write the factory image on. any advice on how to handle that? I also do have a windows pc if need be
 
ok. i think my problem now is the missing partition table. i think its not writing because their is nothing to write the factory image on. any advice on how to handle that? I also do have a windows pc if need be

Try from the beginning, going through the wipe steps and using the commands in the OP to flash it.
 
EDIT:

After hours of messing aroudn with this, it is finally working, thanks to my old Windows Vista PC. Re-created environment on Windows machine and followed instructions to a T again, I was able to write the system img and everything, I am finally back to normal (Well, start screen). So morale of the story.. try a Windows machine if things are not working with your Mac.

---------------------------------------------------------------------------
Just wanted to say I am geting the same errors as most people on a mac, regarding system.img and usb write failings.

edit: I am now stuck on the google loading screen. Frankly not sure what to do at this point. I've also noticed I can NEVER mount sdcard from CWR, so I can't even push anything to the phone. I think since I did all those wipe commands I have nothing to load anymore, so I'm just sitting here with a Google screen or recovery mode screen, or i can boot into CWR.

I've really fubared myself. I can't even run fastboot update </path/to/your/RomFile.zip> to get say the PA rom on it so I at least have something installed.. man how did I mess this up.

It's really annoying that I can't mount ANYTHING via CWR. Can't mount sd card, can't sideload. Tried to push Cyanogen nightly for nexus 4 and I was able to to push the file but I can't apply the darn thing since I can't mount the sdcard! When I try to use fastboot to flash it, it tells me i don't have an android.txt file or something.
 
Last edited:
I had the problem with the -w as well on Windows, told me it was in correct syntax. Moving the -w to after the update word in the syntax worked for me.


Sent from my Nexus 4 using Tapatalk 2
 
Added the bit about switching up the 'update' and '-w' in the command to the troubleshooting tab.. thanks for the feedback :)
 
I am using stock rom and since i just flashed twrp recovery and then i used the recovery to flash supersu. to go back to stock i need to flash the stock recovery only ?.and how to get rid of the supersu .Do i need to flash the stock kernel too?
 
I am using stock rom and since i just flashed twrp recovery and then i used the recovery to flash supersu. to go back to stock i need to flash the stock recovery only ?.and how to get rid of the supersu .Do i need to flash the stock kernel too?

You are stock. If you want to receive OTA's you would need to have (flash) the stock recovery. If you changed the kernel you would need to flash the stock one as well. SuperSU has an option under Settings to Fully Unroot, after which you could just remove the SuperSU apk from /system/app.
 
thank you for your prompt response.
one last question do i really need to erase the custom recovery first to flash the stock one or just flash it without erasing anything ?
 
thank you for your prompt response.
one last question do i really need to erase the custom recovery first to flash the stock one or just flash it without erasing anything ?

Makes no difference. When you're just flashing a recovery, just flash it. When you're doing a full factory image restore it's best to erase everything using the manual erase commands before flashing, but again, not always necessary.
 
Although your solution is not work for me (stuck in X screen), but thanks for introducing Wug's Toolkit for me.. It works perfectly.
I found that Toolkit's one will send userdata and cache after your commands, so is that the problem that make me stuck in X screen?
Sorry for bad English ;)
 
Google has finally put the factory image back on the developer website, so I've cleaned up the OP and taken down the links to mine and peejay's downloads so everyone can get them from the official site.

No explanation as to why it was taken down for about 2 months and the file has not changed at all. I even downloaded the new image and compared the md5 to the file I've been sharing and they match, so no idea what the reasoning could have been.

:)
 
Google has finally put the factory image back on the developer website, so I've cleaned up the OP and taken down the links to mine and peejay's downloads so everyone can get them from the official site.

No explanation as to why it was taken down for about 2 months and the file has not changed at all. I even downloaded the new image and compared the md5 to the file I've been sharing and they match, so no idea what the reasoning could have been.

:)

Definitely strange...

Sent from my Nexus 4
 

Forum statistics

Threads
955,296
Messages
6,964,354
Members
3,163,250
Latest member
tessy89