yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] El Daddy:
You don't flash the factory image in recovery. Its done with fastboot. Follow the guide.
[Nexus 4 General] mistahseller:
Ok thank you! :good:
[Nexus 4 General] Vahndroid84:
thanks efrant

worked like charm :D
[Nexus 4 General] lumi1776:
procedure for kernal

ok im noob to android and am learning and just wanted a bit of hand holding before i try this :)

ive followed the guide and rooted my phone ok all done.

im stock 4.2.2 and stock recovery at present

im going to run a test with betterbattery to see if i suffer from msm_hsic_host wakelock fix in 3g only mode, see here

http://xdaforums.com/showthread.php?t=2102986&highlight=htc+one+m7+v+nexus

if i do then i was going to try the anykernel from that link and see if it made any difference (have u guys had this issue?)

so .. do i need custom recovery flashing on. if so i'll follow guide and sections for that part.

then for the kernel do i need to do all these steps inc the erase cache

11) Flash the kernel/ramdisk: fastboot flash boot boot.img

12) Optional (NOT optional for n00bs) -- Flash the recovery partition: fastboot flash recovery recovery.img

13) Erase the cache partition: fastboot erase cache

14) Reboot: fastboot reboot

now if i decide to go back to stock kernel i have the 4.2.2 image and if i extract it all i can find the boot.img in there is that all i need to go back to stock kernel, if so i can pull that file out n place it in a folder and use it from there.

would i need to make a nandroid if im just swapping kernels

and i am presuming this will break OTA? and ill have to manually update etc in the future if i stay with diff kernel

many thanks
[Nexus 4 General] chrone:
You practically answered your question by yourself. Custom recovery is needed to flash custom kernel. It's also needed to flash back root if you're using stock kernel and get ota update. :)

Sent from my Nexus 4
[Nexus 4 General] cassanoel:
this is my nexus

can i flash to 4.2.1 just like tutorial in first page?

and than i get official update to 4.2.2?
[Nexus 4 General] chrone:
You're already on 4.2.2, why do you want to downgrade and do the ota update?

The latest factory image reset is 4.2.2.

Sent from my Nexus 4
[Nexus 4 General] coldhandz:
Unlocking and Rooting

Hi, I've recently got my N4 and wish to unlock, root it and remain stock for now. I've read lots and just need confirming the steps I should take please.

I've downloaded and extracted the platform tools on page1. Updated drivers, n4 shows as Nexus4 ADB device (or similar) when plugged in with USB debugging ticked.

I need to boot the phone into fastboot mode, plug it in and in the command prompt type fastboot oem unlock

Then Reboot by typing: fastboot reboot-bootloader

Then if I want root (CWM is in the same directory as the platform tools and SuperSU is on my SD card) I type fastboot boot customrecovery.img (this is what i named it) (thinking now the SuperSU app will be deleted after unlocking the bootloader so I'll transfer it back on after unlocking) then once booted go to recovery and flash SuperSU zip. then type fastboot reboot.

To keep OTA I should keep everything stock. Would you recommend permanatly flasing a custom recovery?

Really sorry for the spoon feeding and any help/confirmation in my steps is well appreciated. I have never used ADB before and am quite frankly petrified:eek: I don't want to use a toolkit as I do want to get my head around ADB.

If I've left anything out of the steps I should take please correct me and again thanks for any advice.
[Nexus 4 General] f.us:
@ coldhandz

Sounds all good.

As for permanently flashing another recovery... what ever suits your needs. You can always flash the stock recovery if needed.

Good luck
[Nexus 4 General] chrone:
you might want flashing custom recovery once you rooted your phone since the root will be wiped out when an ota update occurs, thus supersu/superuser needs to be reflashed once again. chances are you'll get to download the ota update manually from xda first than the official notification, and flash it via custom recovery. :D
[Nexus 4 General] coldhandz:
Thanks. In order to permanently flash recovery I type fastboot boot customrecovery customrecovery.img? and none permanent i type recovery fastboot boot customrecovery.img?

I know your right regarding getting the ota update from xda first, just trying to be safe with using adb (i'm still learning):)
[Nexus 4 General] chrone:
To flash it permanently you need to type "fastboot flash recovery customrecovery.img". Fastboot boot customrecovery.img will only boot the custom recovery once while leaving the installed recovery intact. Also, fastboot and adb is two different thing. :)

Sent from my Nexus 4
[Nexus 4 General] coldhandz:
Thanks again friend. My brain just fried for a second when you said fastboot and adb are two different things:/ Correct me if wrong but they are two different .exe files in the same folder that can be both controlled by cmd prompt? Ahhhhhhh :fingers-crossed:

I've got lots to learn!!!!
[Nexus 4 General] chrone:
Hehe take it slow, i'm newbie too.

Fastboot is to be used inside the bootloader, while adb is to be used in android with usb debugging mode with lots of command lines available, or from inside a recovery with very limited command lines.

You could learn these two things from efrant's guide on android 101 for nexus 4. :)

http://xdaforums.com/showthread.php?t=2010338

[REF] "Android for the Nexus 4" 101 & FAQs

Sent from my Nexus 4
[Nexus 4 General] coldhandz:
Will do my friend. But again, I can use cmd prompt to unlock and root n4, no need to currently worry about the differences between fastboot and adb? thank you

---------- Post added at 07:31 PM ---------- Previous post was at 07:28 PM ----------

Will do my friend. But again, I can use cmd prompt to unlock and root n4, no need to currently worry about the differences between fastboot and adb? thank you

PS bookmarked 101 & FAQ's;)
[Nexus 4 General] CarlosCruz15:
Question: After I unlocked my boot loader, and rooted my phone I made a nandroid of my "stock image". So my question is, can I just reflash that bad boy and be good? Like will I have stock radio, kernel, etc? And will I get OTA updates from Google?

Edit: I understand original instructions specify to flash the radios, etc. for a full stock experience, but I'm just curious if my original nandroid would do the trick. If I can keep a somewhat, complete stock phone while maintaining root permissions and unlocked boot loader (until the next update from Google) that'd be awesome.
[Nexus 4 General] efrant:
The nandroid script will back up your ROM, kernel, recovery and userdata. It doesn't backup your radio or bootloader, but everything else, essentially yes.
[Nexus 4 General] CarlosCruz15:
Thank you. So if I just restore my original nandroid and then flash stock radio I'll be set to receive OTA updates? By the way, thanks for the thorough guide, it's really beneficial.
[Nexus 4 General] f.us:
You don't have to, at this moment at least, worry about the difference. They just talk to you device on different levels.

chrone explained it already:

Since both exe files are located in the same folder (if you follow the guides) and you're using the cmd prompt to call them (you described the steps/commands several posts earlier) everything will be fine.

It just means: if you type adb in cmd it calls adb.exe; if you type fastboot it calls fastboot.exe
[Nexus 4 General] cassanoel:
it is about battery life.. in the first time i think the update (4.2.2) will solve my battery problem but after official update meh.. i still stuck with battery drain...

so.. what about downgrade to 4.2.1 with efran's tutorial (because LG didn't properly install stock rom 4.2.1) so i get the "right" 4.2.1 and than upgrade to 4.2.2 to solve my battery problem??
[Nexus 4 General] chrone:
3g battery life is still not good, but i got 6 hours screen on time on 2G network only with 11 hours up time. :)

Why not flash the latest 4.2.2, less hassle that way. :D

Sent from my Nexus 4
[Nexus 4 General] shomispc:
I need help with this. My friend bought a N4 from a carrier (Telenor Serbia), and he want's to sell it to me for a cheap price. Will I be able to flash clean version 4.2.2 from Google on a device like this? Is it only software locked so I can't use sim card from different carrier or there is more to it?

I successfully flashed my GNex couple of days ago so I'm not a total newbie, but I bought it off contract..

Thanks in advance
[Nexus 4 General] chrone:
Never heard a carrier locked of nexus 4 so far. As long as it is nexus 4, i'm positive you can flash this factory image. :)

Sent from my Nexus 4
[Nexus 4 General] shomispc:
Thanks. tell me one more thing. if I flash stock android I'll lose warranty I guess.

But if I lock bootloader again after the install, will they be able to see that I changed something without them knowing? :)

edit : on their website says that the device will only work with their sim card :/
[Nexus 4 General] chrone:
They wouldn't know if your bootloader has been unlocked and relocked. Well, if you flash google factory image it might wipe the locked sim. :p

But let's hear from efrant and other more experience members first.

Sent from my Nexus 4
[Nexus 4 General] efrant:
Probably not.

some carriers do lock even Nexus devices to their network. I can't see why the N4 would be any different. I'm sure someone would be able to figure out how to unlock it, but I doubt that anyone has tried, as SIM-locked N4's are few and far between.

Have a look at this thread for the GNex to show you an example of how one user figured it out for the GNex.
[Nexus 4 General] efrant:
Unfortunately not. The SIM lock is stored in a different partition than those contained in the factory image.
[Nexus 4 General] shomispc:
So you think that flashing it with factory image won't work?
[Nexus 4 General] efrant:
Flashing the factory image will not remove the SIM lock, no.
[Nexus 4 General] shomispc:
Damn, thanks..

Dunno whether to be happy 'cause I didn't bought it, or to be sad 'cause I won't be able to do what I taught..
[Nexus 4 General] coldhandz:
Would just like to say thanks to efrant for this excellant guide for people trying to learn like me and the others who helped me within this thread!!!! Big thanks guys for helping me unlock, root and install custom recovery, the basics I know but I gotta start somewhere:)
[Nexus 4 General] cassanoel:
can you show the thread?

thanks
[Nexus 4 General] efrant:
http://xdaforums.com/showpost.php?p=34552123&postcount=1 ;)
[Nexus 4 General] atabey:
Is it normal that I still have my custom recovery installed after I did all the steps? (except the optional ones)
[Nexus 4 General] efrant:
There are no optional steps for n00bs -- they are only optional for those that understand what they are doing. Hence the lablel: NOT optional for n00bs.

But yes, if you skipped flashing the recovery image (step D12), you will have kept whatever you had before as a recovery.
[Nexus 4 General] atabey:
yes...because of that I skipped the "optional" ones. But now the rom is still correctly flashed and wont make any problems?

Edit: Ok got it :) D12 was an optional step :D

ps: do I always have to type in the captcha, when I want to post anything on xda?
[Nexus 4 General] efrant:
Yes, the ROM is contained in the system image.

If you want the stock recovery, then flash the recovery partition as well.

No, it will disappear once you reach a certain number of posts.
[Nexus 4 General] osokrayzay:
I am dumb founded. Followed the steps below. I searched and could not find an answer. Once I boot up I still have Super SU installed and root. Only thing I found by searching is that the stock image is to suppose to be flashed in fastboot? But the instructions here says flash all 3 in recovery. I am on page 43 and still reading.
[Nexus 4 General] efrant:
That's my mistake. I assumed that when bigxie said "untouched", then he meant that it was completely stock. I will make the adjustment in the second post, but basically this is what you have to do:

1) Download Terminal Emulator from Google Play and install it.

2) Launch the app and type the following in it:

su
mount -o remount,rw -t ext4 /dev/block/mmcblk0p21 /system
rm /system/app/Superuser.apk
rm /system/xbin/busybox
rm /system/xbin/su
exit
exit

Done.
[Nexus 4 General] osokrayzay:
Ok, I followed the instructions. After the second line of command it fails. "rm failed for /system/app/Superuser.apk, read only file system"
[Nexus 4 General] efrant:
Sorry, trying to type too fast. I forgot a line. Here they are:

su
mount -o remount,rw -t ext4 /dev/block/mmcblk0p21 /system
rm /system/app/Superuser.apk
rm /system/xbin/busybox
rm /system/xbin/su
exit
exit
[Nexus 4 General] osokrayzay:
Success! Thank you
[Nexus 4 General] XNemia:
Hello mates

I finished all the steps to back to stock, every thing is done perfectly. Just one thing is a strange, the X logo takes a long time, just now is reaching the 10 minutes !!

is this normal ?

Thank you, Just did this :

back into the bootloader and tried locking and then unlocking it:

fastboot oem lock

followed by

fastboot oem unlock

And accept it on the phone. Reboot >>> Enjoy !
[Nexus 4 General] popi09:
I'm a little confused? Do I have to download the two files step 5 has?

This is NOT meant to replace going through the steps in post #1. They are there for your learning, and should be used as a primary method of returning your device to stock. However, if your USB port is indeed messed up, then you will not be able to use the instructions in post #1.

Warning: if your USB port is indeed broken, and you complete all the steps below, you will have NO possible way at all to unlock your bootloader, or get root, or install a custom recovery. Period.

1) Ensure that you have root, and a custom recovery (CWM or TWRP) installed;

2) Download segv11's BootUnlocker app from the Play Store, install it and lock your bootloader with it;

3) Download the odexed version of this file (stock JDQ39 ROM) and place it on your device;

4) Download the JDQ39 stock boot image from here and the stock JDQ39 recovery from here.

5) If you want, you can also download the 0.48 radio and the z10o bootloader from here.

6) Reboot into CWM and flash the three files you downloaded in steps 3 and 4, and the file(s) you downloaded in step 5;

5) Turn off your device and reboot into the bootloader;

6) Go to recovery and access the stock recovery menu (i.e., when you see the android with the red triangle, hold power and press vol up) and do a factory reset and then wipe cache.

7) Read and follow this post.

8) Done. Now you are fully stock JDQ39 with a locked bootloader.[/QUOTE]
[Nexus 4 General] masantula:
A quick question, while flashing using instructions in section D the step of flashing recovery, instead of flashing the stock recovery which came with the package can i just flash custom recovery directly instead? Or that is not recommended?
[Nexus 4 General] efrant:
Yes you can flash a custom recovery right away.
[Nexus 4 General] masantula:
Okay cool...i just did that so was abit worried..
[Nexus 4 General] rakeshdev:
ADB Push

Dear Efrant,

With a intention to do a clean set-up of AOKP 6 ROM on my Nexus 4, i did data/factory reset, wipe cache, wipe dalvik cache, format data/media, format cache, format system in CWM touch.

However, since there is no external SD card, the zip files relating to AOKP6 and GAPPS were also cleaned up due to format system command in CWM.

I could not find out as to how once the entire SD card/system is formatted, how do we push zip files into the phone. ADB was able to recognize the phone, but somehow i could not use commands like "adb push xxx.zip /sdcard" or "adb push xxx.zip /sdcard/". Whenever i used these commands, i could not find the file in phone, even though it did reverted saying that file has been copied.

What should be the command to push files in such cases..."adb push xxx.zip /sdcard/0"?

Request you to please throw some light on this issue or help me...may be i'm doing something wrong here.

Thanks a lot.
[Nexus 4 General] efrant:
If you format data/media, you lose everything that is in /sdcard. What you need to do is flash the factory images as per the first post, then boot into Android once. Now you can use adb push (while booted normally or in CWM).
[Nexus 4 General] rakeshdev:
Thanks

Thanks....flashed stock google image and then rooted and returned back to AOKP 6...my mistake...no more format data and media command for me on nexus 4...this is precisely where external SD cards come in handy...come on Google...WTF!
[Nexus 4 General] texaslittleangel:
followed instructions of the OP to a T and phone is now on 4.2.2. After the update however, gallery and camera apps are not working. Every time I try to open i get a "unfortunately gallery has stopped working" error.

I am on stock and rooted. I have cleared data, cleaned cache and dalvik as well as fixed permissions with no avail. I tried pushing 4.2Camera_t04.zip file with no avail.

Can someone PLEASE help
[Nexus 4 General] efrant:
1) Did you do step D10? If no, then do it.

2) If you answered yes above, did you restore any apps (using Titanium Backup or ADB backup or something similar)? If yes, that is your problem.
[Nexus 4 General] texaslittleangel:
Hi efrant,

I did do step D10, I even had to follow the step to regain my 16gb. If my memory serves me well, as soon as I booted back from the factory reset I got the error message, I then restored apps and data via Titanium to see if that fixed the problem (given that I did not have an issue previously). I also added my folders back to the sd

What would you recommend as a fix?
[Nexus 4 General] efrant:
I would bet that you are getting that error because you copied the DCIM folder back your sdcard. There’s prob an ownership or permission issue. Maybe try deleting that folder, then take a picture with the camera (to see if it recreates it), then restore the files you previously had in that folder (but not the folder itself).

If you are getting that error as soon as you flash the images without restoring anything, then I really have no idea what could cause that.
[Nexus 4 General] texaslittleangel:
SOLVED

Deleted folder, cleared cache, dalvik, factory reset and as soon as the phone booted the error message was the first thing that popped up a long with the sign into google account. I went into apps, cleared cache, cleared data and tapped on the camera icon and nothing, just the error message :confused:

EDIT:

I applied this camera patch file I found on one of the XDA boards and it is now in full working order.
[Nexus 4 General] smeliukas:
Hi everyone,

I've had my Nexus 4 for 2 weeks, and it worked fine until yesterday. This is slightly offtopic but I'll mention it anyways since I hope details might help solve my problem. So I was playing realracing3 as usual and my phone rebooted out of nowhere. It hadn't rebooted once in the two weeks I had it before yesterday. After that first reboot it started rebooting quite often, especially whilst gaming. A friend of mine has an HTC which keeps rebooting without any reason, so I suppose this problem is of common occurence. Today the nexus rebooted again, and I found somewhere on the internet that wiping the cache might help. So I did that with some app I found on the Play Store, and manually rebooted the phone to see if it helps. When the home screen reappeared, I wasn't able to use the phone properly anymore. I clicked on messages, the screen froze and the phone then rebooted. This happened a few times and then I tried getting on the settings menu, but it appeared glitchy and the phone then rebooted and did not boot up again since.

I browsed the net for solutions unsuccessfully for half of the day. When I came upon this forum I thought there might be something I can do, but so far nothing has worked. I did the steps posted by the OP, but they did not help. The first time I did only the compulsory ones, rebooted my Nexus and there was hope for a minute, since the working android logo appeared and a green bar was moving, but then the phone rebooted... I tried restarting it a few times, but could not get past the android logo. Then I tried doing all the steps from the guide. These did not help either, and the android logo did not even appear. In fact I could not get past the Google logo. I haven't seen the colourful nexus logo for a few hours now, and it's very frustrating. I read a few pages of the discussion and saw some people couldn't get past by the nexus logo, but I couldn't find any solution that would help me.

I would be very grateful if someone gave me any sort of advice, or directed me towards a solution.

Thank you!
[Nexus 4 General] estallings15:
I've said it before and I'll say it again.

If flashing ALL the stock images does not fix your problem, then it's RMA time.

Don't forget to relock your bootloader.
[Nexus 4 General] smeliukas:
I just flashed 4.2 version instead of 4.2.2 and I actually got to see the nexus logo. But then it rebooted again after a few seconds. Does that really mean RMA now?:/
[Nexus 4 General] estallings15:
Yes.
[Nexus 4 General] undercover:
You have to do factory reset after flashing images....
[Nexus 4 General] estallings15:
Right. I didn't, because I got happy with the erase commands. More than one way to skin a cat, right?
[Nexus 4 General] undercover:
Erase cmds don't work on N4 for some reason, unless it's been fixed in 4.2.2. and newer sdk. Efrant should be able to elaborate more on that.
[Nexus 4 General] estallings15:
Well, mine booted with no issue.
[Nexus 4 General] efrant:
If you are flashing an image to a partition using fastboot, you generally do not need to erase it beforehand. Now, that being said, based on what we've seen, the command "fastboot erase cache" does not seem to do what it's supposed to do, and can cause the N4 to not boot. No idea why. What does seem to work, however, is either booting into the stock recovery and wiping cache OR using the format command instead of erase, e.g., "fastboot format cache".
[Nexus 4 General] stuntman_dan:
Maybe I'm an idiot... but when uninstalling the previous drivers (before installing the universal naked driver) windows just automatically reinstalls the drivers. If I try to do an update, it tells me that the drivers are already up to date, and won't let me change them.

So do I need to install the universal naked driver? Are the ones that windows automatically installs adequate?

*EDIT*

Did some googling and attempted using gpedit.msc to block windows from installing drivers automatically, but when I try to manually install the driver it just tells me that the adb interface driver installation was blocked due to a policy...

I am using windows 7 64-bit
[Nexus 4 General] efrant:
Let Windows automatically install its driver, then when you are trying to install the universal naked driver, choose the option where it says something like "let me choose the driver to install from list" (not "automatically find the best driver"), and then you should see a button that says "have disk". Click that and point it to where you extracted the universal naked driver.
[Nexus 4 General] :
I followed your tutorial but where is the system.img, boot.img, userdata.img and recovery.img? I can't find it.
[Nexus 4 General] 3rdstring:
Yon need to unzip the image-occam-jdq39.zip that is in the occam-jdq39-factory-345dc199.tar
[Nexus 4 General] fengxshui:
i need some help please!

when i do fastboot flash recovery IMAGENAME.img

i get sending 'recovery" <7554kb>...

FAILED < data transfer failure <unknow error>>>

finished.
[Nexus 4 General] spicediablo:
Sorry if this has been asked. How do i prevent the recovery from going back to stock after flashing custom recovery? And how do revert to stock recovery when there is an OTA?

Sent from Mako
[Nexus 4 General] GodKingKnight:
Anyone know if this comes developer unlocked?

Just wondering?
[Nexus 4 General] chrone:
Using latest stable cwm recovery has the option to disable stock recovery being reflashed back after flashing the ota update through cwm recovery.

You might want to download the ota update from link posted in ota update thread here and flash it via cwm if you're using custom recovery since ota only works on all stock rom/kernel/baseband/recovery.

Sent from my Nexus 4