yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] efrant:
What do you mean by flashing cache? Flash means writing an image to a partition in this case. There is no cache.img file to write to the cache partition.
[Nexus 4 General] sorinpanduru2189:
Hello,

I tried different USB port. Also flashed bootloader (rebooted before trying to flash the system.img).

I did not try different cable/computer, but I can do it ... even though it hangs when 'writing system...', not when 'sending system...'

I believe that the actual file transfer is happening on the sending system phase, and it just extracts or something when "writing system", so it shouldn't be cable/computer related...

Will try both thing anyway... and I'm waiting for more suggestions...

Could it be related to the fact that I was coming from CM10.1 ? (maybe different partitions?)

I say this because I erased system multiple times (using fastboot and recovery) and after i flashed back cyanogenmod, all my old apps were already there (shouldn't they be in /system and get deleted when i format /system ?)

Thanks everyone :)
[Nexus 4 General] 3rdstring:
What ROM your're coming from shouldn't matter, they don't change the partitions. User apps are in /data & will be there unless you wipe data or factory reset.
[Nexus 4 General] pauleandro:
You're absolutely right. I've got confused with the nexus 10 files extracted from its image. They where at the same folder as fastboot and ADB was, so I messed everything up.

I just erased everything and downloaded the full image of N4 again.

Thank you.
[Nexus 4 General] muratturatci:
my imei sv has changed from "01" to "03" how can i reset my imei sv to "01" back. please help me?
[Nexus 4 General] chrone:
Muratturaci, you could try flashing back system.img. it won't wipe your installed apps and data, but you might loose root access, if it's so, reflash supersu flashable zip package.

I lost imei couple weeks ago, and flashing system.img did restore my imei back to normal. Hope it works too on your case. :)

Sent from my Nexus 4
[Nexus 4 General] dnkbro:
First off, thanks for the tutorial and all contributions. I have successfully unlocked my bootloader using this thread. However, I'm having trouble rooting my device.

The very first time I plugged my phone into the computer, I didn't have USB debugging on and Windows manually installed the drivers. I had access to all the folders within the phone's internal storage (Alarms, DCIM, Music, etc). After I installed the ADB drivers from Stryder5's thread (Link: http://xdaforums.com/showthread.php?t=1992345) the phone no longer appears under my computer. I went to Device Manager and uninstalled and deleted the ADB drivers and let Windows automatically install drivers. The phone now appears in "My Computer" now and I have access to the internal storage. Where is "/sd card" so I can put SuperSU? If I re-install the ADB drivers I can't access the internal storage again.

My apologies for the n00b questions.

*edit* I got everything working. SuperSU is on phone and it looks like it's good to go.
[Nexus 4 General] spicediablo:
Sorry if this has been asked. Will rooting my nexus disqualify me from OTA updates? I'm looking to migrate my data from my old ace to my new phone and need to root in order to use titanium backup. Thanks!!
[Nexus 4 General] chrone:
As long as you don't modify the system, bootloader, radio, kernel, and recovery you'll pass ota but will loose root, needs to be reflashed again via cwm recovery.

Sent from my Nexus 4
[Nexus 4 General] spicediablo:
I've gone through post 1. That means in order to root my nexus 4, I have to unlock my boot loader first(steps d1-d4).not necessary to flash the boot loader right?

Then proceed to section e?
[Nexus 4 General] chrone:
yeap, unlock and go straight to section e for rooting. have fun! hehe :)
[Nexus 4 General] dnkbro:
I too was a little confused on this part and ended up re-flashing stock when I was already on 4.2.2. Still learned some stuff. :good:
[Nexus 4 General] chrone:
haha. at least you learned something in the way. welcome to the club! :D
[Nexus 4 General] spicediablo:
Where can I find the fastboot.exe? Is it zipped together with the firmware?
[Nexus 4 General] dnkbro:
Thank you sir! Now I have to figure out what exactly I want to do now that I'm rooted. :D

With regards to the drivers. Download the drivers from Stryder5's thread (Link: http://xdaforums.com/showthread.php?t=1992345). Go to computer, click manage, click device manager, find the nexus 4, and update the drivers by selecting browse and finding the folder of the extracted drivers you just downloaded. When it is installed correctly, there will be a section labeled Android Device and it will say Android Bootlader Interface. When you plug your phone into your computer, the specific location to open up the command prompt is the folder you extracted the "platform-tools-v16" zip. Easiest way is to right-click in this folder while holding the shift key and click "open command prompt." Make sure your computer can read your phone in adb mode by typing "fastboot devices". Your phone's serial number should show up.
[Nexus 4 General] spicediablo:
Done unlocking my bootloader. Now for the CWM part. I have downloaded SU and am looking for /sdcard directory but can't seem to find it....

Update: I've placed the file in root directory and it seems to work.

I would like to test to see if CWM was successfully installed. Here's what i did, I rebooted into bootloader, then selected recovery and then i saw an android with a red exclamation mark with no options. Do I have to press volume up+power to get to the options?
[Nexus 4 General] dnkbro:
When you select "apply from sd zip" or what not, you click the folder "0" and then select the SuperSU-v0.98.zip. This should fix the issue.
[Nexus 4 General] thephantom:
What you see is stock recovery opening screen. This is when you need to press those buttons to access the menu. Most likely you did only a temporary boot of cwm to be able to root the device so you were successful in rooting but you still have stock recovery
[Nexus 4 General] spicediablo:
I think i'll stick with stock recovery for now. Not that I am doing any imaging of my system right now. Thanks for the help!! I am new to Nexus 4.
[Nexus 4 General] alexxdj:
Hi guys, i flashed the recovery and su without problems but when i want to reboot into recovery i cant!! I saw an android with a red exclamation mark with no options!! Do you know how i can fix this issue? :confused:
[Nexus 4 General] trueblueram:
Move your eyes to the top of your screen for answer. It's magic.
[Nexus 4 General] alexxdj:
delete...........
[Nexus 4 General] mumaster20:
Now i got one question, i know the OP said in the origional post that you dont have to relock your bootloader again for warranty.

Now i dont know if i can leave it opened, since i didn't buy my phone at google but at another shop.

Is it possible to relock the bootloader after i've done everything to return to stock? or will it mess something up?
[Nexus 4 General] thephantom:
Actually it's more of unless you need to return the device for warranty purposes, you don't need to relock your bootloader. You can relock it anytime whether you're on stock or custom firmware. If you need to unlock again though, you run the risk of losing your data so you need some time for restoring everything. Of course for rooted users there is an app for locking/unlocking which may be done on the phone itself without data loss but that's another story since we're talking of simply locking after flashing stock

Flowed and Tapped from my Nexus
[Nexus 4 General] mumaster20:
Ahh allright, i thought i read somewhere that i messed something up and people couldn't reboot their devices anymore.

Guess thats not true, thanks!
[Nexus 4 General] sunhoww:
hi

i also just need to flash the stock recovery over TWRP. do i need to use this first?

fastboot erase recovery

also will i need to unlock the bootloader and root the device again?
[Nexus 4 General] chrone:
you don't need to erase, just flash the stock recovery on top of twrp recovery will do you just fine. but feel free to erase the recovery partition.

in order to use fastboot command you need to unlock the bootloader first, and no, flashing recovery won't unroot your rooted device.

hope this helps. :)
[Nexus 4 General] jlear3:
Hey I was on the move so I just did the second post tutorial, boot loader is locked and I have the odexed JDQ39 Rom but I have root still? I deleted super su from system/app but root checker says I still have root, how fan I get rid of root to send the phone to Google?thanks!

Edit: just saw the xbin path, I'll delete those. Should be fine and should have read a little more before posting.
[Nexus 4 General] Spec-Chum:
EH?

Hey all, long time lurker etc etc :)

Um, the answer may be on here and I've just missed it, but I've successfully rooted my beloved N4 using the instructions above (thanks efrant!) but, now I'm not complaining here, it didn't wipe anything! Everything I had on my phone is still on my phone, it's exactly like it was before I unlocked the bootloader, but it's now unlocked and confirmed as rooted??

Shouldn't fastboot

fastboot oem unlock

wipe the phone as per the bold bit above?

:D
[Nexus 4 General] efrant:
Well, I can't really confirm myself (as I unlocked right out of the box), but others have said it didn't either. I know on the Galaxy Nexus, some did wipe and some didn't. We never figured out what the difference was.

In any case, I wouldn’t worry about it.
[Nexus 4 General] Spec-Chum:
Hi efrant

Not worried at all buddy, I considered it a bonus haha

I did the instructions above and rooted as normal using CWM, then got stuck on the X screen so cleared cache and booted fine. Everything exactly how it was, even down to my call log etc

Not that there was much on the phone anyway, only got it yesterday :D
[Nexus 4 General] malukiz:
Why not use the flash-all.bat given by google ?
[Nexus 4 General] chrone:
Because efrant wants us to learn something a long the way. We don't learn anything if using the flash-all.bat script. By flashing one by one, we learn how to upgrade or downgrade each partition the way we wanted, troubleshoot on which step the installation goes wrong and such. :)

For instance, we now know how to flash different radio/baseband, different kernel/boot, different recovery, erase cache, erase/wipe other partition, and so on.

Sent from my Nexus 4
[Nexus 4 General] Vadaxkicker:
section D. not working

i am pretty sure i followed the instructions perfectly for sections A.,B., and C. However in command prompt (btw the hold shift trick didn't work for me in windows 7 i had to use cd) I keep getting the error: " 'fastboot' is not recognized as an internal or external command, operable program or batch file."

i am trying to flash only boot.img, system.img, recovery.img of JOP40D
[Nexus 4 General] chrone:
are you sure you have the fastboot.exe inside the folder which contains the images you want to flash?

and why do you need the JOP40D instead of JDQ39 the latest one?

might want to put all the needed files (fastboot.exe, boot.img, system.img, and recovery.img) in one folder, ie.:

put all the files in C:\nexus

from cmd/terminal: cd \nexus

fastboot devices

fastboot flash system system.img

fastboot flash boot boot.img

fastboot flash recovery recovery.img

the fastboot.exe is included inside the platform-tools-v16.zip from the first post attachment.
[Nexus 4 General] taxzkee:
Awesome guide!! Thanks you. I rooted my N4 with it :)
[Nexus 4 General] Archometron:
Greetings,

It's taking me an awful amount of time to install the image system.img (larger than 1 hour at the moment).

I'd like to know if it's a common thing to happen or if I should start troubleshooting for problems.

I'm running Windows 7 64 bits. Any other information you might need, I'll provide.
[Nexus 4 General] El Daddy:
It should only take about a minute. Try another USB cable or port on your PC.
[Nexus 4 General] Archometron:
Hey,

Thanks for the quick answer. I tried another usb cable and another usb port and the problem was not solved... Is there anything else you might think can be causing the problem?

I tried Google's flash-all.bat but it got stuck at the same point, though a message appeared after 'writing the radio' and rebooting:

< wating for device >

archive does no contain 'boot.sig'

archive does no contain 'recovery.sig'

archive does no contain 'system.sig'

After that it started checking a bunch of things, sent the system and got stuck at writing it.

I also tried redownloding the system image file to no avail.

Between tries I accidentally booted the system, which it did without any problems. I thought this system image was crucial because it carries the 'operative system' (this is a guess) and without it being properly installed I thought the phone wouldn't boot. Does this mean that the image is properly installed despite the fastboot not finishing the writing process?

Thanks for your patience. Regards.
[Nexus 4 General] El Daddy:
Hmm I'm not sure. Sorry. Maybe when efrant checks the thread he'll have an idea.
[Nexus 4 General] undercover:
It is installed. Wherever properly or not, well, that's for you to find out in due course. Unless you flash any other rom and /system gets overwritten anyway. It's crucial for stock, but it's not if you intent to flash custom rom.

Btw, when you reinstalled it again, did you restart cmd window? Did you reboot PC? Weird things happen occasionally. Also, if you are bothered about it and want to do it, you could try flashing it on its own, without the rest of the images, to make sure cache doesn't just get full up.
[Nexus 4 General] Vadaxkicker:
thanks didn't have fastboot.exe
[Nexus 4 General] mario24601:
Great info!

I have mine back to unrooted and loaded with 4.2 then ota updated to 4.2.2 but seems little off to me. Lil laggy and connecting to USB via Mac not working so well as was before. Is there way to do clean install 4.2.2 on Mac? I don't care if wipes data. Thanks.
[Nexus 4 General] 3rdstring:
Download the Google 4.2.2 images & fastboot flash them
[Nexus 4 General] Vadaxkicker:
How long can this take. My phone has been on starting animation for the past 2 hours i think.
[Nexus 4 General] 3rdstring:
Note that some users indicate that they can't get past the X on boot. If this happens to you, reboot into the bootloader and select recovery. Then, when you see the Android with the red exclamation mark, hold power and press volume up to take you to the menu. Wipe cache. If that still doesn't work, boot back into recovery and do a factory reset.

^^From the op^^
[Nexus 4 General] pak-stars:
power down..use toolkit to flash temp recovery...wipe cache and factory reset/wipe date and you will be ok
[Nexus 4 General] Vadaxkicker:
wipe cache and factory reset/ wipe data using cwm recovery? or the one built in android in settings. Which toolkit should i use?

---------- Post added at 09:26 PM ---------- Previous post was at 09:20 PM ----------

i had flashed only boot, system and recovery.img in an attempt to keep data, however i am guessing that i cannot in my case? i have backups but it would be annoying
[Nexus 4 General] pak-stars:
use wugfresh toolkit..it will flash a temporary recovery clockwork
[Nexus 4 General] Vadaxkicker:
thanks. And through this temp cwm recovery i reset to factory/ wipe data/ wipe cache?
[Nexus 4 General] El Daddy:
You need to wipe cache in the STOCK recovery. Not a custom one.
[Nexus 4 General] Vadaxkicker:
also when i hold down my power button, it shuts down and starts again on its own and stays at the startup animation. Its in some loop idk
[Nexus 4 General] Vadaxkicker:
how do i do this if i go into recovery mode through fastboot and it gives a error
[Nexus 4 General] chrone:
You could try:

fastboot erase cache

fastboot flash recovery cwmrecovery.img and fastboot boot cwmrecovery.img

or fastboot flash recovery recovery.img and fastboot boot recovery.img

Sent from my Nexus 4
[Nexus 4 General] efrant:
Let's please stop discussing toolkits in this thread. The toolkits have their own threads and, given that I do not believe toolkits are the right way to go, I would appreciate it if people stop recommending toolkits in this thred. Once people know what their doing, then they can use a toolkit to make the process faster, but until then, they will never figure out what is wrong.
[Nexus 4 General] trueblueram:
Agree. Toolkits ------> http://xdaforums.com/showthread.php?t=2011328 -------> this thread is a scenic route you don't want to take.
[Nexus 4 General] Vadaxkicker:
help

ok so by default my phone was 4.2.1 JOP40D and i have flashed all the 4.2.2 JDQ39 Factory Image in fastboot (the only thing i skipped was fastboot oem unlock since my bootloader is already unlocked). After your suggestion i did "fastboot erase cache

fastboot flash recovery recovery.img and fastboot boot recovery.img" i havent done cmwrecovery.img because i thought the point was to do this in stock recovery. Or maybe i have it wrong and i should flash cmwrecovery.img to do a factory reset only?

The thing that is happening right now is that i go into recovery either by the fastboot boot recovery.img or manually through fastboot it shows me Android with the red exclamation mark. Then i hold the volume up button with the power button and that does nothing apart from rebooting and gets stuck at startup X animation. What should I do?

I am liking the help i'm getting here and i hope i can get my phone running again before monday. Thank you in advance
[Nexus 4 General] El Daddy:
Press and hold power then quickly press power up and let go of both simultaneously. Then menu will show.

Its a bit tricky to learn the exact cadence. Once you get it, it'll be easy..
[Nexus 4 General] undercover:
FYI. Once you see dead droid, hold power button and tap volume up. Easy as pie and no rush.
[Nexus 4 General] Vadaxkicker:
The two posts above are perfect. Went into stock recovery and wiped cache and it booted up to normal finally. And it shows the updated 4.2.2. Thanks a lots guys. I am pretty sure i had troubles because this is my first android and i used some other toolkit (which kinda sucked tbh)
[Nexus 4 General] Mercado_Negro:
Thank you very much for this. I couldn't get past the X logo either and your suggestion worked just perfectly.

For those you can't get past the X logo and don't know how to boot into recovery just make sure your device is fully shut down and then press and hold VolDwn and Power button (both at the same time... to be honest, this was kinda hard for me because I couldn't get it to boot the first time, newbie). It will go straight up to the bootloader. From here, you can follow this guide to wipe data/factory reset and wipe cache:

http://www.howtogeek.com/130611/how-to-factory-reset-your-android-phone-or-tablet-when-it-wont-boot/

I guess we have to go through these little "heart-stoppers" to learn a bit more about our devices and how they work :)

Cheers
[Nexus 4 General] efrant:
I could be mistaken, but is this info not in the first post?
[Nexus 4 General] CamoGeko:
Your first post is very hard to concentrate on.

I suggest you separate the steps, then add some different colours and text formatting to make it easier to read.

I just tried to read through it myself and my eyes almost watered after 2 mins. :(

Also, what exactly is the point of flashing another radio when all people want to do is unlock bootloader and root??
[Nexus 4 General] chrone:
Well, no pain no gain. It's the learning curve.

There's a section near the bottom of the first post for rooting, no need to flash radio. Other sections above are for returning back to stock. :)

Sent from my Nexus 4
[Nexus 4 General] efrant:
Maybe I can try to separate the sections a little differently, which may make things clearer. As for fonts, different colours and text formatting make MY eyes water, so I won't be adding that. :)

There is no point in flashing another radio if all you want to do is unlock the bootloader and root. Step C2 clearly says what to do if all you want to do is unlock your bootloader. And part E says exactly what you need if you want root, i.e., an unlocked bootloader.
[Nexus 4 General] galaxys2Tav:
what gets me tho is why would the bootloader of radio need to be flashed in the first place? dont get me wrong iv have a nexus device before and iv never seen any advantage of flashing a bootloader or radio :/ even going back to stock am i right in thinking they dont need flashing?
[Nexus 4 General] efrant:
Radio: A lot of individuals flash different radios for various reasons (e.g., performance, enabling features like LTE, etc.). However, if you are using a radio that does not correspond to the version of Android that you are running, you are technically not stock, and future OTA updates will not install on your device.

Bootloader: There are no obvious advantages to flashing a new bootloader. However, it may be required. Even going back to the days of the Nexus One, updated Android builds would NOT run on the older bootloader. I have also seen other isssues with running an older bootloader with a newer Android build on the Galaxy Nexus. So, it is recommended (if not essential), that you keep your bootloader updated.
[Nexus 4 General] galaxys2Tav:
Right now I get it thanks for taking your time to clear it up for me. It was I was just a bit confused that Was all.

I understand about the bootloader and not been able to run different android versions as it's the same with the hboot on the one x. You need the 1.3+ hboot to have jellybean.

The radio I understand as well I won't be needing LTE as the UK has only just got 4G so it won't be in my area for a long while.

Thanks again :)

Sent From My Pure LG Nexus 4
[Nexus 4 General] efrant:
Did you read the entire first post?
[Nexus 4 General] undercover:
Nope.

--------------------------------

Sent from my fridge. Make: LG Model: N⁴
[Nexus 4 General] trueblueram:
Flash first, ask questions later - Seems to be the new mo:)
[Nexus 4 General] silent assassin:
Awesome thanks !

Maybe best in section D point 4 add a Note that if you only want to unlock bootloader and root skip to 14 :), or am I wrong (total noob here)?

I agree with you that everyone should learn a little bit about how Android works before they start flashing etc, but I also hope that the barrier for people is small enough. I know a lot of people with non nexus phones (I was before a couple of weeks one of them) that want to have a stock android experience, but don't want to have to search days on how to get CM on it. I do hope that there will come some universal CM tool or something that can do all of these things (but this will probably take alot of time/effort/money).

Thanks again, will try it step for step when I am back home (my Nexus 4 isn't unlocked, but first need to backup with Carbon Backup or manually with your link in the OP).
[Nexus 4 General] mesarabi:
hi

if i want to flash a rom and phone went to boot loop what can i do?because i can not remove battery so what can i do?
[Nexus 4 General] chrone:
Root: D 1 & 2, and all E.

It would be wiser read all the steps to get to know what you're doing before start flashing and troubleshoot later. :)

Hold the power button for 10 seconds or so, it will be powered cycle.

When it's rebooting press power and volume down until the boot loader appears, up/down with volume button, select recovery mode, and enter by pressing the power button.

Once you're in stock recovery mode with android robot with exclamation sign, press power then volume up. Might a bit tricky to show up the recovery menu, keep trying with the power and volume up thing. Then after the menu shows up, select wipe cache, and you're done.

Sent from my Nexus 4
[Nexus 4 General] mistahseller:
I am trying to revert back to stock rom and these are the steps I am taking.

1) boot into recovery

2) factory reset

3) wipe cache

4) wipe dalvik cache

5) installing zip from sd card

6) when I try to install the stock image image-occam-jdq39.zip it returns this....

finding update package--> opening update package--> installing update---> installation aborted

I am using Clockworkmod recovery 6.0.1.9 and trying to flash from pacman rom to stock image from google. I can flash other roms just not the stock one from google's website.

Any insight is very much appreciated