yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Android Development] Joshua3109:
Awesome, I got the path put into cmd and have the phone unlocked!

Now im running into another hurdle; I am getting this error message when I try to flash the CWM.

"error : cannot load recovery.img : No error "

Edit* Haha, I had the CWM file renamed literally to "recovery.img" and not "recovery"! It worked perfectly once I took out the ".img"
[Nexus 4 Android Development] marty331:
Your CWM recovery should have been named recovery.img, can you boot into recovery and confirm that you have CWM installed?
[Nexus 4 Android Development] Joshua3109:
Yup, I have root, have CWM and Superuser. Got titanium working and am going to be flashing soon. :)

BTW: I have been in Recovery on my Desire and Sensation before. I know I am in it and it is working. Thanks for the help guys!
[Nexus 4 Android Development] ian577416:
I would suggest no frills CPU controller it's available on the play store.
[Nexus 4 Android Development] FallingEdge:
Can I get a link to the Matrix kernel? I see no threads on the Nexus 4 Android Development forum.
[Nexus 4 Android Development] ian577416:
A lot of the kernels are under "original android development" here you go mate http://xdaforums.com/showthread.php?t=2007231
[Nexus 4 Android Development] Maverick1707:
This might be a noob question but... I installed CWM 6.0.0.6 instead of the latest version.

Now, once I have N4 rooted and with CWM 6.0.0.6, can I normally flash CWM 6.0.1.9 ? by doing so, everything else would remain unchanged and root not affected and the latest OTA which I just installed (4.2.1) will not automatically flash the stock recovery? (I just selected YES when CWM asked me to prevent the OTA to flash stock recovery after reboot).

Thanks!
[Nexus 4 Android Development] THE_KINGDOM:
What about posting the ADB and Fastboot files in the OP?? Without these fastboot and adb commands are impossible..
[Nexus 4 Android Development] HQRaja:
ADB and fastboot can be installed as part of the Android SDK. As most of us here at XDA have it (or know how to install it), I omitted that from the OP, but for the absolute beginners, I added information on getting those in the very beginning of the guide, if you read the first couple of sentences.
[Nexus 4 Android Development] :
Hi guys, I have latest CWM installed but i got one problem. I am unable to rename my backups via Rom Manager Premium. It gives me an error each time.. How to go about it?
[Nexus 4 Android Development] 3bs11:
Same thing happened to me and now there's an update in the Play store that fixes that. Tested and it works.
[Nexus 4 Android Development] euki69:
Hey guys, I'm sorry if this was already asked but before flashing SU and Busybox, I did as suggested and made a backup. ... I can't seem to find the back up anywhere and the idea that it is taking up space, and i dont know where it is is bothering me.

I searched and someone said there is a sdcard/0 folder using cwm on a galaxy nexus but I do not have such a folder. thanks
[Nexus 4 Android Development] 3bs11:
Try /mnt/shell/emulated/ that's where I found mine.

Maybe in /data/media/ mine are also here.
[Nexus 4 Android Development] euki69:
It was located in your first suggestion, thank you so much!
[Nexus 4 Android Development] tbrouwer:
Hey guys, when I do the fastboot oem unlock command, the phone asks me to volume up to confirm unlocking bootloader. Which is great, but all the buttons on the phone are then unresponsive, so i can't "volume up" to get to the unlock choice. Any ideas?
[Nexus 4 Android Development] Chochiwpg:
I have used this method to root my phone without issue, worked great. I used the boot CWM method instead of flash CWM to flash the SU zip. If I was to flash CWM will it stick on my phone after reboot? Or do I have to flash the revert recovery disabler script while in CWM? Thanks.
[Nexus 4 Android Development] nibrwr:
Did you try touching yes? Volume up worked for me
[Nexus 4 Android Development] banks1359:
Awesome resource. Thanks. It was an excellent guide.
[Nexus 4 Android Development] DJMartini:
Was having so much problems until I found this ... Thank you!!!!
[Nexus 4 Android Development] droidor:
Hi Guys,

I received my Nexus 4 on Thursday after a long LL3 wait. First thing I did was unlock bootloader, install cwm as described here. I didn't realize that this would break the OTA update. When I click on "System Update" it says it will reboot my phone (countdown) but it never does. So I went back to the original stock recovery from here. Bu it still doesn't reboot.

Any ideas?
[Nexus 4 Android Development] nibrwr:
Flash stock system, boot, recovery images
[Nexus 4 Android Development] droidor:
Thanks. That fixed it :)
[Nexus 4 Android Development] jimmyz:
For an OTA do you need the stock recovery? It seems like with CWM as your recovery it will work?
[Nexus 4 Android Development] mitchdickson:
A Google search that took 0.49 seconds to complete tells me that OTA's will not work with CWM installed.
[Nexus 4 Android Development] jimmyz:
Now waste another 1 sec of your life reading this thread: http://xdaforums.com/showthread.php?t=2017611

or cut right here: http://xdaforums.com/showpost.php?p=34808237&postcount=13
[Nexus 4 Android Development] chairhome:
So I messed up and replaced the wrong drivers, I think. My nexus 4 no longer comes up as a storage device (it used to, I went into device manager -> Storage Devices -> Nexus 4. Then replaced the drivers with the one in the OP. I guess that was the wrong place to put it). Anyone know which drivers I need to replace now? When I plug in my N4, autoplay shows up for "nexus 4" with no options. And it doesn't show up in windows explorer, either. Help wanted :(. Thanks.
[Nexus 4 Android Development] nibrwr:
Worked for me.
[Nexus 4 Android Development] Dave778:
+1 I have a Nexus 4 & am wondering the same thing...

Do we have to flash the revert recovery disabler or will CWM stick after reboot>?
[Nexus 4 Android Development] nibrwr:
I believe that only runs the first time you reboot after installing CWM.
[Nexus 4 Android Development] yduck:
I followed your method 1 and there is no error. But how do I know the phone is rooted? how can I verify?

after rooting, I noticed the "secure boot - enabled" in fastboot mode, what does that mean? should root disable it? if not, how can I disable it?

Thanks
[Nexus 4 Android Development] BRKotucs:
Download root checker from the play store.
[Nexus 4 Android Development] Crenshaw-PCGH:
So after root etc we cant do any ota updates?
[Nexus 4 Android Development] Soundchasr:
Where is says "code:" in the first post, where do we type that in? :confused:
[Nexus 4 Android Development] androidfoshizzle:
If I were to do this, what can i do afterwards?..since the Phone has nothing bad about it:rolleyes:
[Nexus 4 Android Development] CMNein:
You can DL the OTA from and flash it manually via CWM, or sideload via ADB, so long as you haven't flashed a kernel/theme/removed any system apps, etc..., etc...

Install ADB/fastboot and install the drivers on your PC. Those commands are entered in the command prompt while your phone is in fastboot mode. There's enough keywords in the previous sentence for you to search.

Not sure what you're asking.
[Nexus 4 Android Development] Raul69.atl:
So i got my phone today and when i turned it on had an update and i installed it :/

Can i still root!? Im on J0P40D now (4.2.1)
[Nexus 4 Android Development] otariq:
Yes u can, I rooted today with the same updated 4.2 version. Just use this toolkit it's really simple to unlock bootloader, root and flash recover. If u want cwm go to the options to select it first before starting
[Nexus 4 Android Development] androidfoshizzle:
Whats the point of hacking the Phone and trying to make it better than it already is?..I root it, then what? Not using a rom, so what else is there to do?...
[Nexus 4 Android Development] Raul69.atl:
Welcome to freedom!!

Sent from my Nexus 4
[Nexus 4 Android Development] apzalo:
Not to get this thread off topic, but if you purchased the N4 through Tmo, aren't those phones updating to JOP39B? If they come back with JOP40C, I am pretty sure they are going to wonder what is up.
[Nexus 4 Android Development] HQRaja:
Exactly, that file does it all for you. Needless to say, phone must be in fastboot mode, Android SDK must be installed with tools and platform tools (for fastboot), the path to these folders must be in your PATH variable, and the necessary drivers must be installed.
[Nexus 4 Android Development] 0.0:
so if i have root and an unlocked bootloader, doing the above method to get back to stock will erase my phone and it'll be stock again? would i need to unroot my phone first, or does the process above do everything for me? and to lock the bootloader, is it just "oem lock" or something using adb right? or will the factory image restore lock the bootloader for me as well?

sorry for the noobish questions. this is the first time with a nexus device

---------- Post added at 11:43 PM ---------- Previous post was at 11:40 PM ----------

both the tmobile version and play store version are the same phones. so i would think they both get the same software
[Nexus 4 Android Development] HQRaja:
Yes, it will get the phone back to stock in every aspect except for your internal sd card content, and the bootloader lock state. You can relock your bootloader in fastboot mode by using 'fastboot oem lock' just the way you unlocked it using 'fastboot oem unlock'.

While you're at it, you can do 'fastboot oem unlock' again and it will clear all your internal sd card storage too. You can then again do 'fastboot oem lock', and it will be in 100% factory state in every aspect except for those scratches and dents you put on its hardware, or the coffee you spilled on it etc.

PS: To keep things on-topic here, I suggest everyone takes such questions to the Q & A section please. Thanks =)
[Nexus 4 Android Development] Oggy512:
what do you mean with OTA?

I'll probably get mine today and i thought to root it. So i make the personalisation on the first boot and then making the procedure from first thread, because fastboot is erasing everything, so i think i made it directly better?!

or did i have to do something else? (i.e. OTA???)

thanks!!
[Nexus 4 Android Development] DerKiLLa:
OTA = Over the Air (Update)
[Nexus 4 Android Development] Oggy512:
oh. ok. you mean i should first do an update (is there really one? i mean it's a brand new device?!) and then do the root procedure?! :)
[Nexus 4 Android Development] 0.0:
yes, update. then root
[Nexus 4 Android Development] apzalo:
Deleted.
[Nexus 4 Android Development] Meaple:
Works like a charm. Thanks for this guide :D
[Nexus 4 Android Development] exadeci:
Well after unlocking phone was wiped I don't know why, but now my N4 is rooted
[Nexus 4 Android Development] adaimespechip:
Doesn't seem to work for me..

Installed the OTA when I got the phone this morning, unlocked bootloader.

Booted via unsecure boot.img, followed the commands to push and chmod all files and root checker is still throwing up 'not rooted'

Shall I reboot via normal boot now?

EDIT: nvm, installed Busybox from play store and it asked for SU permissions..
[Nexus 4 Android Development] :
Yep I done these exact steps last night to root my N4, although was too tired to post a guide.

Now I think we need a way to disable the "secure boot" which I'm guessing will be done when we're able to flash an insecure boot.img, although I may be wrong.
[Nexus 4 Android Development] lexxxel:
I did my OTA before i tryed to get root, too. After the first not working try i had to unlock developer settings again and the second try helped me to get root.

So I have root and I tryed to get it after the update!

This methode works fine for me. (German N4)
[Nexus 4 Android Development] chucky8:
getting same error here
[Nexus 4 Android Development] Stryder5:
Did you run the fastboot command to boot into the unsecure boot.img before the rest of the steps?
[Nexus 4 Android Development] ElectricAndi:
Received an OTA 3 hrs ago. Kernel built date was 2012/11/08 (YYYY/MM/DD) afterwards.

Trying to root now, but am stuck after Step 8 with endless bootanimation :(

EDIT: Got it working.

After unlocking disconnect you phone and boot normally (niot via adb unsecure boot.img). It will boot (wiped of course). Just shut it down and boot in bootloader. Connect to PC and proceed with step 8.
[Nexus 4 Android Development] chucky8:
yes, did everything like in the guide.

i continued anyway with the commands and it seemed to work.

i dont know why the error message shows up
[Nexus 4 Android Development] MadCobbler:
I got that same error when I tried su, but I just carried on with the chmod commands and it worked even though the su failed, I still have root

Edit: Damn beat me to it lol
[Nexus 4 Android Development] ElectricAndi:
I can confirm this.
[Nexus 4 Android Development] ElectricAndi:
If you cannot think about any advantages, please leave us and delete your xda account.
[Nexus 4 Android Development] androidfoshizzle:
Hahaha
[Nexus 4 Android Development] sambao21:
I followed the directions, and I seem to be rooted as I'm running titanium backup right now, but one thing that I'm not sure of is whether I should've done a factory reset or not.

I did not, and all of my apps, and settings didn't get deleted, so it seems great that I didn't have reinstall and reconfigure everything. My question, is this normal?

I've read warnings that all data is wiped when you unlock, but none of my data was wiped. Did I do something wrong or is the instructions outdated?
[Nexus 4 Android Development] attmakesmevomit:
I just got my Nexus 4 tonight as an upgrade for my Galaxy Nexus GSM... I'm very familiar with flashing both custom and stock images on the Gnex and my GSM Xoom MZ604, so I wasn't too worried about the process... but ran into some problems.

I followed the instructions from the OP and flashed the latest CWM touch recovery img through fastboot, and immediately booted into recovery. I then rebooted the system, and it went into a boot loop... I had NOT wipe the caches before I rebooted the system. Then, I rebooted into recover and flashed the latest CyanogenMod nightly (md5 checked out), hoping that would fix the issue... I wiped cache and Dalvik after flashing CM, then installed Gapps, wiped cache and Dalvik again, and got a different boot loop (CM boot animation instead of stock "X").

I just flashed back to stock and all is good now, but I'd like to go ahead and flash CyanogenMod before I go through the trouble of setting everything up to my liking. Can anyone give me a heads up as to whether NOT wiping the cache and Dalvik before flashing the CyanogenMod update.zip would have caused it to boot loop even after flashing an entirely new system image? Thanks in advance!
[Nexus 4 Android Development] nibrwr:
CM publishes installation instructions. Backup.

Wipe /data, /cache, Dalvik, /system.

Install CM. Install GApps.

Reboot.
[Nexus 4 Android Development] attmakesmevomit:
Thanks. I'm aware of CM install instructions... I'm more concerned with why the phone wouldn't even boot to the stock ROM after installing CWM.
[Nexus 4 Android Development] kiwiBeans:
I just received my N4 yesterday - opened it up and started setting it up and configuring it out of excitement. I went and performed the JB update to 4.2.1 and read that it is still no problem to root with it so I went ahead and followed the instructions in this thread.

So everything went fine but I had two unexpected things happen and I'm not sure what to think of it. Basically, at the final step # 12 of the ClockworkMod Recovery Method, I rebooted (I DID clear the cache and Dalvik, BTW) and just before the system rebooted I was unexpectedly still in the recovery style menu and got the message: "ROM may flash stock recovery on boot. Fix?". Since I didn't know what to do here I just said No, instead of scrolling to yes and rebooted.

First unexpected thing: my phone booted up right where it had left off before I rooted it. Aside from the unlock icon during the boot, my wallpaper, apps and settings were all in tact. I scrolled through my apps and saw SuperSU so that made me believe I was rooted. The first app I could think of to test this out was Screen Filter. I installed it and it immediately crashed. So, I figured between that and my device not actually being wiped out, that I must have done something wrong and maybe I wasn't rooted after all.

I re-rooted, if you will. Went through everything again. Of course, the unlock command failed because it said I was already unlocked. Re-flashed the SU package, etc, but this time, when I got the above message "ROM may flash stock recovery...." I chose yes. Rebooted and everything was the same... unlocked lock icon during boot, phone was still set up, SuperSU in the app drawer. It was only then that I thought maybe something was wrong with the app I used to "test" root (Screen Filter). Sure enough, the comments show it's not compatible with 4.2 yet. I installed two other apps that I could think of that need root: Quickboot and Titanium Backup and was able to grant root access. I can confirm from that I'm rooted.

So, after all that, I have two questions. Why did my phone not get wiped out when I unlocked the bootloader as it says it will be in the tutorial? I'm not complaining as I'm glad it wasn't... but it makes me think I didn't do something right. Second, what's up with the "ROM may flash stock recovery on boot. Fix?" message that I got and is it ok that I said yes? I think it said something about "preventing" something - I'm not sure now.
[Nexus 4 Android Development] HQRaja:
For the ones curious about their data not getting wiped during the unlock process, unlike previous Nexus devices and the expected behavior, unlocking the bootloader doesn't wipe the Nexus 4 for several users, and you were amongst them. At present, I'm not sure whether it's intended or some bug from Google's end but so much the better, heh. The unlock process still works perfectly fine, so worry not. I have also updated the OP to add this.

Regarding the prompt in the recovery about preventing the stock recovery from being flashed, the stock ROM for Nexus devices includes a script that automatically reflashes the stock recovery upon Android reboot, if it finds it modified. The new versions of ClockworkMod as well as AOKP now automatically ask you if you would want to disable that script so that your custom recovery stays, so again it's all OK. =)
[Nexus 4 Android Development] kiwiBeans:
Thank you! You're awesome. I'm very glad it didn't wipe me out, but I read all instructions to the letter and when it said the command "will" wipe your data, that was the exact behavior I expected. I'm thankful for the warning though, as it made me perform a backup of what I had on the device (not much since I just got it, but still) and prepare for the worst, anyway.

As far as the second question, I can't remember exactly how that ROM flash option was worded, so I'm not sure if it was asking if you want it to do it, or want it to not do it/prevent it. I know I said 'no' first, then said 'yes' later when I thought I messed something up. I believe, according to what you said, that it's asking if the user wants to keep the ROM from flashing the stock recovery. Since I said 'no' the first time around, why didn't it flash the stock recovery? I'm assuming it didn't because I can still get into CWM.
[Nexus 4 Android Development] HQRaja:
In case you are referring to my bootloader unlocking guide at AddictiveTips that was linked from the OP, that one was written with all Nexus devices in mind and that's how it has been on them; this exception has only started to surface in case of Nexus 4 recently, for some users. That's why the 'WILL' part; better safe than sorry. =)

As for the question ClockworkMod asked you, it was what I just mentioned - it offers you to prevent the stock recovery from reflashing (by disabling that script), with several 'NO' options and one 'YES' option. Selecting 'NO' would keep that script, meaning you'll lose your custom recovery upon the next reboot, while selecting 'YES' would mean the custom recovery will stick. Regardless of the option you choose, your device should still get rooted. The only difference will be what recovery you have afterwards. If you still have CWM installed, you selected the option to disable that script and prevent the stock recovery from getting reflashed automatically by the ROM upon reboot.

EDIT: Just read the part about you asking why didn't it reflash the stock recovery when you selected 'NO' the first time. I am certain it did so the first time but as you mentioned, you went through the complete process again the second time and selected 'YES' this time, that's why you still have ClockworkMod recovery installed.

Hope this clears everything up.
[Nexus 4 Android Development] zabihjan:
Why the backup doesn't work

It says backup completed but I can't find it nowhere

Thank you
[Nexus 4 Android Development] HQRaja:
If you *cant* find it *nowhere*, that necessarily means you *can* find it *somewhere* :D

The backups taken from clockworkmod recovery are stored in the 'clockworkmod/backup' folder or was it clockworkmod/backups?) on your SD card. In this case, it should be /sdcard/0/clockworkmod, which should redirect to /data/media/0/clockworkmod/backup if I recall it correctly.
[Nexus 4 Android Development] kiwiBeans:
It does! Made me slap my forehead when I read your explanation - I must have had a long day at work or something because I understand completely now. You're perfectly correct - I did re-do the process, including flashing the CWM recovery a second time, which is why I still have it despite allowing the script to flash the stock one the first time around. Thanks so much for your prompt and succinct explanations and help!

When I use a file manager like Astro or Root Explorer to look around, I can't find a CWM or backups folder anywhere. I even did a search in RE with no results. However, if I go through CWM and choose to restore, I DO see the backup file come up in the list, and the directory as /sdcard/clockworkmod/backup/ . This emulated, /0 file tree has got me confused, too. :scratchesHead:
[Nexus 4 Android Development] zabihjan:
Cant find it
[Nexus 4 Android Development] zabihjan:
Titanium backup cant find

I did manual search via root explorer. I cant find it

I find recovery folder but it is empty

I done backup twice no luck
[Nexus 4 Android Development] intern:
Same problem here. Can't find the backup folder. I just installed a CM10 nightly if that makes a difference.

It seems like a problem with the mount points? Koush mentions something similar here - https://plus.google.com/103583939320326217147/posts/eh2NpJGKsnb

EDIT : Found it, it's in /mnt/shell/emulated, found it using ES File Manager.
[Nexus 4 Android Development] zabihjan:
I managed to find it through recovery restore option but I cant make copy of to my PC.anyways now I am using liquid smooth alpha 7 and all this possible due to cwm recovery
[Nexus 4 Android Development] sas007:
CWM

Hello i rooted my device using the Nexus 4 Toolkit.(worked like a charm)

is there now any way i can install the ClockworkMod Recovery (touch) on my device.

using the method described in page one after using the nexus 4 tool to root,would it be safe to do? will it work?

i understand you can boot into it without flashing but i would like it on device if possible.

many thanks.
[Nexus 4 Android Development] kiwiBeans:
Bingo - thanks for pointing that out. I could not find it with Astro, but could with ESF and Root Explorer. Now, how the heck can I back that up off the device?
[Nexus 4 Android Development] blackcoffee85:
Be sure to wipe caches and the like, my device wouldn't boot without this step.
[Nexus 4 Android Development] Blazing angel:
I've been searching, but i cannot find an answer

How do we restore the stock recovery script