Related
SO i rooted my device as i recall to my prior knowledge and i did correctly. Now i've been searching and while i'm confident the steps i have to make are correct i thought i'd still ask to save me from future trouble.
So JDQ39 is the stock firmware i have and of which i made a back up.
Lets say a new update comes out, 4.2.3 or whatever you want to call it. So basically all i would have to do is restore my nandroid backup.
So far so good, next thing i would have to do is install the stock recovery.img (fastboot flash recovery recovery.img) which i got from the zip located here: https://developers.google.com/android/nexus/images with the title: "Factory Images "occam" for Nexus 4
Android 4.2.2 (JDQ39)"
Basically extract the recovery.img, flash it
and then proceed to fastboot oem lock and voila i'm done?
can anyone confirm please? thank you
Download the stock google image file from google for nexus 4 and extract the files in your fast boot directory adb then run the script job done.
Read whole OP
http://forum.xda-developers.com/showthread.php?t=2010312
It sounds like a lot but if you your computer recognizes your device (fastboot devices), it is really easy.
Small extraction:
C. Download the required files to your computer and extract them
1) All of the files that are required, need to be in one (i.e., the same) directory. It does not matter what it is called, but all the files need to be in there, with NO subfolders. EVERYTHING needs to be extracted into this one directory;
2) Download the attachment from the end of this post and extract the contents to the directory created in step 1. Note: if all you want to do is unlock your bootloader, skip to step 7 in this section (C).
3) Download the version of Android you want from https://developers.google.com/android/nexus/images. Make sure you are using an occam image which is for the Nexus 4. Most old versions are not usually available on that site; however, there is a mirror on this site: Random Phantasmagoria.
4) Download the appropriate version (for your computer) of 7-zip from here and install it.
5) Extract the files from within the .tgz file which you downloaded in step 3 using 7-zip, not WinZip or WinRAR or whatever.
6) Make sure you have extracted ALL the files (including extracting any files in any archives inside the .tgz file). You should have six (6) files ending with .img in the directory you created in step 1. The other files you extracted from the .tgz are not necessary;
7) Reboot your device into bootloader mode (by turning it off, hold volume down, and press and hold power) and plug it into your computer;
8) Open a command prompt in the same directory (i.e., make sure you are in the same directory as your files are located). You can hold the shift key when you are in the folder in Windows explorer and right-click in a blank spot and it will open a command prompt.
shadehh said:
SO i rooted my device as i recall to my prior knowledge and i did correctly. Now i've been searching and while i'm confident the steps i have to make are correct i thought i'd still ask to save me from future trouble.
So JDQ39 is the stock firmware i have and of which i made a back up.
Lets say a new update comes out, 4.2.3 or whatever you want to call it. So basically all i would have to do is restore my nandroid backup.
So far so good, next thing i would have to do is install the stock recovery.img (fastboot flash recovery recovery.img) which i got from the zip located here: https://developers.google.com/android/nexus/images with the title: "Factory Images "occam" for Nexus 4
Android 4.2.2 (JDQ39)"
Basically extract the recovery.img, flash it
and then proceed to fastboot oem lock and voila i'm done?
can anyone confirm please? thank you
Click to expand...
Click to collapse
if you simply rooted and would want to get future updates, there is no need to restore your nandroid. if with your root you installed a custom recovery, you are correct that you need to flash stock recovery to install an ota, however with custom recovery installed, someone will surely post a link to the update zip so you can do the update manually using your custom recovery. bootloader won't matter in getting a new update so there is no need to lock it back. you can keep it unlocked and updates will work fine. do note that when an update arrives and installs, if you don't have rootkeeper, you'll lose root so just keep an updated supersu flashable zip in your virtual sdcard so you can simply re-root thru custom rcovery after receiving an update.
So I downloaded the newest stock image and I've done all I need to do in terms of drivers and such. But the file is a .tgz and when I try to push it it says "adb cannot read sideload." My device is being detected by adb in cmd. I also notice if you unpack the file there IS a zip, but there's also a new bootloader and such.
Do I have to have an unlocked bootloader for this to work? Or will flashing the .zip be okay?
I did this same thing today but I had to unlock my bootloader. ( which wipes all your data). I also had to extract a few levels deep in that file. You should research doing a factory image install because there are a few steps to do with fast boot besides pushing the 1 file over.
Sent from my Nexus 10 using Tapatalk 4 Beta
Recon0212 said:
So I downloaded the newest stock image and I've done all I need to do in terms of drivers and such. But the file is a .tgz and when I try to push it it says "adb cannot read sideload." My device is being detected by adb in cmd. I also notice if you unpack the file there IS a zip, but there's also a new bootloader and such.
Do I have to have an unlocked bootloader for this to work? Or will flashing the .zip be okay?
Click to expand...
Click to collapse
Hi! I also got the same sideload error when I tried to update my nexus 4 to 4.3. Turns out the drivers were faulty. I recommend that you uninstall and delete your current drivers from device manager and install the Universal Naked Driver from here and then sideload the file.
It worked for me.. Lets see if it works for you too.
About the .tgz part, extract the file, move all IMG files into one place and flash them one by one (reboot bootloader each time). Now erase the cache (fastboot erase cache and fastboot format cache), clear the cache again from recovery mode then to a factory reset.
Tired of waiting for the OTA? Can't use it because you're rooted? Don't want to wipe your entire phone? No problem! Here's how you can upgrade with Google's Nexus factory images without wiping your apps or sdcard.
NOTE: You must have your bootloader unlocked. If you've never unlocked your bootloader, I don't think there's any way to do this without wiping your data.
STEP 1: Install fastboot
Fastboot is Google's utility for flashing factory images. You can also use it to flash custom recoveries like TWRP and CWM. The standard way to get is is through Google's Android SDK, but that's a bit heavy-duty, so you can also download just the most important tools (fastboot and adb) separately, packaged by users. Here are some links:
Official Google Android SDK (cross-platform): http://developer.android.com/sdk/index.html#Other[1]
Unofficial for Windows: http://developer.android.com/sdk/index.html#Other[2]
Unofficial Mac/Linux: http://code.google.com/p/adb-fastboot-install/[3]
Windows users might also need to install drivers: http://developer.android.com/sdk/win-usb.html[4] (can any Windows users confirm whether it's necessary?)
STEP 2: Prepare factory image
Download the latest Nexus 6 factory image at https://developers.google.com/android/nexus/images#shamu[5]
Unzip it and open the resulting folder
Unzip the "image-shamu-*.zip" file in there
You should now be looking at something like this: http://i.imgur.com/mzrfwrP.png [6]
STEP 3: Flash! (Ah-ahhhhh! [7] )
Connect your phone to your computer via USB, and enter the bootloader. You can enter the bootloader by holding down the power and volume-down buttons to boot. Once you see the bootloader, you can release the buttons.
Open a terminal/command prompt. The syntax might be slightly different on Windows than on Mac or Linux, but basically the same. Anything you see in <> you need to replace, e.g. with the actual path to your factory image folder. The rest you should be able to copy and paste. (Tip: you can easily enter a folder path into your terminal/command prompt by simply dragging the folder onto your terminal window. This works on Mac, Windows, and the vast majority of Linux GUIs.) Enter these commands:
cd </path/to/shamu-lmy47d>
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
Reboot the bootloader.
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
cd <image-shamu-lmy47d>
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash system system.img
If you DO NOT use a custom recovery (like TWRP or CWM), then also: fastboot flash recovery recovery.img
Don't worry if you see messages like "target reported max download size of 1073741824 bytes". Just wait and let it finish.
Reboot your phone and enjoy. It's normal for the first boot to take a while. Going from Kitkat to Lollipop took about 20 minutes. Going from 5.0 to 5.0.1 took 5-10, I think. YMMV.
A WORD OF WARNING: If you're moving between ROMs, you generally should do a complete reset, including wiping data. Many users have reported problems going from KitKat to Lollipop without wiping data and recommend a factory reset anyway. If you're okay with wiping everything, you can simply use Google's included flash-all scripts, or flash the userdata.img file yourself. Personally, I'm not going to bother wiping adta for an incremental update like 5.0.1->5.1. As always, be sure to back up your data!
Shamelessly stolen from: http://www.reddit.com/r/Nexus5/comments/2phqy7/howto_upgrade_android_using_nexus_factory_images/
Shouldn't you also fastboot reboot bootloader after radio flash?
This is the scenic route.
I tried to update using wugz, without unlocking the bootloader. failed. Oh well, I'll wait to receive ota
Unless this method doesnt require unlocking?
If you have an OTA zip file, this is different than using a System Img?
I do not think you need to lose data or unlock your bootloader?
Found a link for the OTA zip file.
If I remember right you can copy the zip to you phone with a USB cable.
Go into the bootloader, Volume Down and Power.
Select the zip.
I did not think you needed a terminal and all the commands if you had the OTA zip on your phones SD card.
Am I wrong does something like this not work?
or
I can just wait.....
This worked great.
I was unbranded with VZ sim, unlocked, rooted with TWRP recovery. Didn't want to lose all that nor my apps or data. This method upgrades to 5.1 without any loss.
When I was done with the flashing, I rebooted to TWRP recovery (not system) in order to wipe dalvik and cache (just to be certain). I wiped and then rebooted to system. TWRP noticed I didn't have SuperSU installed so it installed it for me. Meaning, once I got my system rebooted, I still had root too.
All in all, this process worked great for me. Thanks.
I run the first two commands
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
fastboot reboot-bootloader
they worked, then i moved to the radio
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
but it failed.
Any idea?
---------- Post added 14th March 2015 at 12:17 AM ---------- Previous post was 13th March 2015 at 11:53 PM ----------
Nikos2k said:
I run the first two commands
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
fastboot reboot-bootloader
they worked, then i moved to the radio
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
but it failed.
Any idea?
Click to expand...
Click to collapse
This is the message after the radio flash command:
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
target reported max download size of 536870912 bytes
sending 'radio' (85422 KB)...
OKAY [ 2.697s]
writing 'radio'...
(bootloader) flashing modem ...
(bootloader) flashing modem ...**☺
FAILED (unknown status code)
finished. total time: 3.721s
Why the failed message?
I'm decrypted. Will this re encrypt my Nexus or do I have to flash a non enforce img?
Thank you, this really helped.
Since my bootloader was locked i had to unlock it as well.
Had a bit of a scare with the whole erasing screen staying on for too long.
Went back and redid the process, and went downstairs for 5 minutes, came back and phone was booted.
Anyway, thank you again
Will this work on an encrypted phone?
mikeadamz said:
Tired of waiting for the OTA? Can't use it because you're rooted? Don't want to wipe your entire phone? No problem! Here's how you can upgrade with Google's Nexus factory images without wiping your apps or sdcard.
<<snip>>
Click to expand...
Click to collapse
I don't suggest that anyone read and follow someone else's instructions when doing something like this. Not because the instructions are wrong or anything, but because blindly following instructions doesn't involve *understanding* anything.
So rather than reading and following instructions, read and UNDERSTAND the process of installing factory images as delivered with the factory images (flash-all.sh). If you UNDERSTAND the process and what everything does, then (a) you *already know* what needs to be adjusted to do what you want, and (b) if something starts going wrong in the middle of it, you will understand why, and what to do to correct it.
mikeadamz said:
cd </path/to/shamu-lmy47d>
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
Click to expand...
Click to collapse
First, thanks for the write up, I do greatly appreciate it. Second, thanks for the tip on dragging file locations into the command prompt. Very helpful.
Now my question. When I did this I tried using exactly the steps above and had no luck whatsoever. I'd cd to the location of the img files as noted and it would say fastboot is unrecognized as an internal or external command. I moved the file into the fastboot location and got the same issue. I finally ran the fastboot from the adb folder location and just referenced the full file path for each img file (using the drag and drop method) and everything went swimmingly. My question is just about using fastboot. Should it have worked when I used cd to go to the img file location? Is there something I need to do to make it work as you described?
Thanks!
Nick
Nick D said:
First, thanks for the write up, I do greatly appreciate it. Second, thanks for the tip on dragging file locations into the command prompt. Very helpful.
Now my question. When I did this I tried using exactly the steps above and had no luck whatsoever. I'd cd to the location of the img files as noted and it would say fastboot is unrecognized as an internal or external command. I moved the file into the fastboot location and got the same issue. I finally ran the fastboot from the adb folder location and just referenced the full file path for each img file (using the drag and drop method) and everything went swimmingly. My question is just about using fastboot. Should it have worked when I used cd to go to the img file location? Is there something I need to do to make it work as you described?
Thanks!
Nick
Click to expand...
Click to collapse
Install this:
http://forum.xda-developers.com/showthread.php?t=2588979
Now ADB and fastboot are installed system wide. Put your files anywhere, I use the desktop. Hold shift and right click on wherever your files are and select "open command prompt here" and flash away. Simplified, no more dragging and dropping.
Will try with the new update (5.1.1 (LMY48M)) to ensure it works. Thanks!
[/COLOR]
handyarrow said:
Will this work on an encrypted phone?
Click to expand...
Click to collapse
Have been flashing this zip in twrp after the fastboot stage without an issue for the last few updates - http://forum.xda-developers.com/nexus-6/development/mod-disable-force-encryption-rom-kernel-t3000788
Flashed LMY48M with fastboot method and it works great.
My phone is encrypted.
Hello!
I have the Nexus 6P and I have successfully rooted 16 phones over the past 4 years and never had a problem I couldn't fix. Today I made a mess of my new phone.
I had a perfectly working custom ROM with an unlocked boot loader with TWRP (2.8.7.2) installed. I installed some custom soft keys and got into a boot loop. I went and flashed what I thought was the stock ROM according to the website I was following, and I re locked my boot loader like a fool and was going to eventually unlock it.... turns out I was still boot looped.
I have tried:
sideloading 3 different zips, always get the message "cannot read zip" whatever the zip is
I tried changing the names, doing the full names, doing a stock rooted zipped ROM, nothing works.
I have used SkipSoft and Wugs toolkit and I can't flash ANYTHING or transfer files onto the phone unless the bootloader is unlocked.
I have installed the Google drivers multiple times, ADB devices always works, it seems to not be a driver issue because I can do everything else fine.
I have let the phone sit for 35 minutes in bootloop waiting for it to come back online so I can tick that "OEM unlock" button in the settings menu.
I have also done a dozen other things, the problem is nothing I have done or tried allows me to get any ROM or any file onto the device to flash in TWRP.
Help?
ok shot in the dark here. I had a boot loop until I flashed the flashable vendors zip
I got it in this thread:
http://forum.xda-developers.com/nexus-6p/development/rom-pure-nexus-layers-fi-wifi-calling-t3244563
Give it a whirl if you haven't already.
Found this in the Pure Nexus Project thread, so props to them for providing this.
-MotoNexus- said:
Hello!
I have the Nexus 6P and I have successfully rooted 16 phones over the past 4 years and never had a problem I couldn't fix. Today I made a mess of my new phone.
I had a perfectly working custom ROM with an unlocked boot loader with TWRP (2.8.7.2) installed. I installed some custom soft keys and got into a boot loop. I went and flashed what I thought was the stock ROM according to the website I was following, and I re locked my boot loader like a fool and was going to eventually unlock it.... turns out I was still boot looped.
I have tried:
sideloading 3 different zips, always get the message "cannot read zip" whatever the zip is
I tried changing the names, doing the full names, doing a stock rooted zipped ROM, nothing works.
I have used SkipSoft and Wugs toolkit and I can't flash ANYTHING or transfer files onto the phone unless the bootloader is unlocked.
I have installed the Google drivers multiple times, ADB devices always works, it seems to not be a driver issue because I can do everything else fine.
I have let the phone sit for 35 minutes in bootloop waiting for it to come back online so I can tick that "OEM unlock" button in the settings menu.
I have also done a dozen other things, the problem is nothing I have done or tried allows me to get any ROM or any file onto the device to flash in TWRP.
Help?
Click to expand...
Click to collapse
Thanks, the problem is I can't find a way to sideload anything or move a file over. Everything results in a myriad of errors.
tigercranestyle said:
at worst, you would have to invoke the flash-all command via adb once you extracted the couple of times that you have to. directions are on google's factory image site.
may not be the answer that you were looking for, but it always feels great having a clean device to work with. i mean as it stands, you would have to set everything back up on whatever rom anyway if you somehow got out of the problems you were having. you would spend more time doing that instead of just going the factory image route.
toolkits are fun, but learning your way around them is even more so.
Click to expand...
Click to collapse
I'm gonna check the flash all,I've never done that before. I think that would be all the images in the tgz factory image? Anything to get my phone back yeah, I just need it working again.
-UPDATE- I tried the flash all batch in the system image and I tried the flash all batch command and neither work.
Hey man - crazy story - I literally just got done messing with a toolkit and the EXACT same situation happened to me. Locked bootloader, bootloop, everything. What you need to do is do a complete wipe of everything in TWRP so you can access /data from your PC (unless it isn't messed up currently, and you can decrypt within TWRP, I couldn't...) Then, download Cataclysm (maybe something else will work, idk, but I just did it with cataclysm) and bam - it boots, head to developer options and get the box checked.
Stock images didn't work, nothing did... was scared I had a brick. The saving grace for us is that we both got TWRP installed. No more toolkits for me!
Melamunna said:
Hey man - crazy story - I literally just got done messing with a toolkit and the EXACT same situation happened to me. Locked bootloader, bootloop, everything. What you need to do is do a complete wipe of everything in TWRP so you can access /data from your PC (unless it isn't messed up currently, and you can decrypt within TWRP, I couldn't...) Then, download Cataclysm (maybe something else will work, idk, but I just did it with cataclysm) and bam - it boots, head to developer options and get the box checked.
Stock images didn't work, nothing did... was scared I had a brick. The saving grace for us is that we both got TWRP installed. No more toolkits for me!
Click to expand...
Click to collapse
I have already done the advance wipe and the format data, I just tried again and my computer will not read it as storage with MTP enabled.
Thanks though!
tigercranestyle said:
after extracting the tgz file, it should become a tar file. after extracting that tar file, it should become the six files listed below. these files should be in platform-tools to start from scratch.
bootloader-angler-angler-02.45.img
flash-all.bat
flash-all.sh
flash-base.sh
image-angler-mmb29m.zip
radio-angler-angler-02.50.img
once they are, open command line in that directory (platform-tools) and then "flash-all" should work. if it doesn't make sure you post the error that you're getting on your computer so that others can help.
Click to expand...
Click to collapse
I followed all these steps, I unzipped it and everything and put it in my fastboot folder. I still get the "unknown partition "all" " orrr flash is not recognized as an internal or external command, operable program or batch file. In an attempt with desperation I tried opening every version of the batch file, in the tgz and tar and unzipped AND in the fastboot and it all gives the radio img error.
I still do have my fastboot device connected, to my knowledge that means it can't be a driver problem right?
-MotoNexus- said:
I followed all these steps, I unzipped it and everything and put it in my fastboot folder. I still get the "unknown partition "all" " orrr flash is not recognized as an internal or external command, operable program or batch file. In an attempt with desperation I tried opening every version of the batch file, in the tgz and tar and unzipped AND in the fastboot and it all gives the radio img error.
I still do have my fastboot device connected, to my knowledge that means it can't be a driver problem right?
Click to expand...
Click to collapse
You can't flash anything in fastboot with a locked bootloader. The only way you can get your device to work is by using TWRP to flash a rom.
The flash all command doesn't work because the extracted tar file has A zipped folder inside that has to be extracted also with radio and I think recovery zipped up. You have to extract those two files to put them in the tar file and then you might be able to flash all. But as long as you can fastboot devices you should be able to flash all 6 files and have a brand new device.
tigercranestyle said:
sorry for the late reply. not always here.
1. did you unlock the bootloader again before doing all of this?
2. list the files that are in your platform-tools folder.
3. when you executed the "flash-all" command earlier, you did do it with the dash in between flash and all... right? also, you're doing it without the quotation marks, right?
sorry if they seem silly. just never really know.
Click to expand...
Click to collapse
He can't unlock the bootloader without booting into a rom. He needs to use twrp to flash a full system but I am not sure how to help with that when he can't sideload.
just an unrelated question... why did you lock the bootloader again? what was the purpose?
also, as mentioned... locked bootlader, odds arre USB debugging and OEM unlock are also not checked.... afaik, youre in trouble... hopefully someone else can sav you, im out of ideas
akellar said:
You can't flash anything in fastboot with a locked bootloader. The only way you can get your device to work is by using TWRP to flash a rom.
Click to expand...
Click to collapse
Are you telling me that I'm bricked?
I have no way of transfering files to the devices, it won't read as anything to transfer files and ADB won't sideload anything.
tigercranestyle said:
sorry for the late reply. not always here.
1. did you unlock the bootloader again before doing all of this?
2. list the files that are in your platform-tools folder.
3. when you executed the "flash-all" command earlier, you did do it with the dash in between flash and all... right? also, you're doing it without the quotation marks, right?
sorry if they seem silly. just never really know.
Click to expand...
Click to collapse
Neither am I , I just got back from a trip. I have the fastboot exe adb exe mfastboot exe the ADB api files, and the ROMs I tried to sideload along with all the images I pushed to the device.
Originally I had the bootloader unlocked, like I said I was being a fool blindly following a tutorial to get back to stock and I locked it too soon.
Yeah, I tried flash-all flash all and flash flash-all / flash flash all
dontbeweakvato said:
The flash all command doesn't work because the extracted tar file has A zipped folder inside that has to be extracted also with radio and I think recovery zipped up. You have to extract those two files to put them in the tar file and then you might be able to flash all. But as long as you can fastboot devices you should be able to flash all 6 files and have a brand new device.
Click to expand...
Click to collapse
Okay I unzipped that folder and put all the files in the fastboot folder, I still get the same error. The thing that scares me here is I can use the batch file now and it just gives me an error saying it can't flash because it's bootloader is locked.
Soulfly3 said:
just an unrelated question... why did you lock the bootloader again? what was the purpose?
also, as mentioned... locked bootlader, odds arre USB debugging and OEM unlock are also not checked.... afaik, youre in trouble... hopefully someone else can sav you, im out of ideas
Click to expand...
Click to collapse
They are default unchecked, hence the reason I can't unlock the bootloader again. I said it in my first post, I was being a fool following some guide to get back to stock and ******* up a step.
rift999 said:
He can't unlock the bootloader without booting into a rom. He needs to use twrp to flash a full system but I am not sure how to help with that when he can't sideload.
Click to expand...
Click to collapse
Is there not a way to fix the sideload? Or a way to get my computer to read it as a media devices so I can transfer files or something? It's always worked with previous phones but my computer reads the 6P differently. (even when it was working)
Stop trying to fastboot flash anything, it will not work as I've already started multiple times. The only option you have is to get something moved to storage and flash it from twrp.
akellar said:
Stop trying to fastboot flash anything, it will not work as I've already started multiple times. The only option you have is to get something moved to storage and flash it from twrp.
Click to expand...
Click to collapse
I've tried every driver from Google and Nexus 6P, I can't get it to read the MTP for a file transfer, what would you suggest I do? it doesn't show up as my old phones used to in the computers drives.
I have found 0 success with getting a file on through file transfer or ADB push file.
-MotoNexus- said:
I've tried every driver from Google and Nexus 6P, I can't get it to read the MTP for a file transfer, what would you suggest I do? it doesn't show up as my old phones used to in the computers drives.
I have found 0 success with getting a file on through file transfer or ADB push file.
Click to expand...
Click to collapse
Can't help too much personally, but you might give this a shot:
http://forum.xda-developers.com/showpost.php?p=64317181&postcount=20
Sent from my Nexus 6P using XDA Free mobile app
So I just got it............!!!!! I have spent a total of 16 hours with videos, forums and trial and error. When I was going back the 5th around time messing with drivers I turned my ADB driver into a USB composite because I had no idea I could and instantly I was able to file transfer!!!! Problem solved, I have my ROM on now.
Thank you all for your help! I am so sorry I derped at this, I have been doing this a long time and just got sloppy.
Introduction
Hello everyone, this is a guide to assist you with customizing your Pixel 2! I will be going over installing fastboot and adb, unlocking your bootloader, how to flash the factory images for clean flashes and upgrades, and how to root. Please feel free to ask any questions if you need clarification. Enjoy!
This information has been distilled from Google's official factory image site and the Magisk thread.
Installing fastboot and adb
Thankfully, Google has provided just adb, fastboot, and systrace as a simple zip file, making this process super easy. You MUST be on at LEAST 26.0.2 for the commands in this guide to work. When in doubt, grab the latest copy and install them using the following instructions.
SDK Platform-Tools for Windows
SDK Platform-Tools for Mac
SDK Platform-Tools for Linux
Windows:
Unzip the folder somewhere on your hard drive.
Go to the folder containing the adb and fastboot files and type "cmd" in the path bar at the top.
A command prompt should open with the current folder showing on the prompt.
Type the following commands:
Code:
adb --version
fastboot --version
You should see some information appear. If that is the case, you were successful!
Mac/Linux:
Unzip the folder somewhere on your hard drive.
Navigate to that folder with your terminal.
Run the following commands:
Code:
sudo install adb dmtracedump e2fsdroid etc1tool fastboot hprof-conv make_f2fs mke2fs mke2fs.conf sload_f2fs sqlite3 /usr/local/bin
sudo mkdir -p /usr/local/lib64
sudo install lib64/libc++.so /usr/local/lib64
Type the following commands:
Code:
adb --version
fastboot --version
You should see the version information, along with telling you they are installed to /usr/local/bin. If so, you were successful!
Unlocking the bootloader
WARNING: This WILL wipe your entire phone. Please make copies or backups of any important data. This can also go wrong rendering your device inoperable. Proceed with caution.
On your phone, open Settings, navigate to "System" then "About phone", and tap on the build number 7 times.
Go one menu up, click on "Developer options", and turn on USB debugging and OEM unlocking.
In your terminal, type the following command:
Code:
adb reboot bootloader
Run the following command:
Code:
fastboot flashing unlock
Follow the prompts on your device then reboot!
Flashing factory images
NOTE #1: You CANNOT downgrade factory images. Google has prevented users from doing so to keep them safe from vulernabilities that were patched. You should only upgrade or reinstall the current image.
NOTE #2: If you have mounted /system as rw at any point (like in TWRP), you must upgrade using the factory image method. OTAs will fail because they cannot verify the integrity of the disk since its verity data has been changed.
NOTE #3: Flashing the factory images requires an unlocked bootloader. Flashing the OTA zips does not (but if anything goes wrong, you may not be able to recover without an RMA).
Updating to a new release (factory image):
Download the latest factory image from Google's website.
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Inside you will see a bootloader image, a radio image, an image zip file, and a couple of flash scripts.
If you are on Windows, open the "flash-all.bat" file in a text editor. If you are on Mac or Linux, open the "flash-all.sh" instead.
Remove the "-w" flag before the fastboot command towards the end of the file. This will prevent fastboot from formatting your device.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Updating to a new release (OTA zip):
Download the latest OTA zip from Google's website
Reboot into recovery:
Code:
adb reboot recovery
Hold down the power button and push volume up
Select "Apply update from ADB"
Run the following command from the folder containing the OTA zip:
Code:
adb sideload <zip_name>.zip
Reboot once it is finished!
Clean flashing a factory image (wipe everything):
Download the latest factory image from Google's website
Reboot into the bootloader:
Code:
adb reboot bootloader
Unzip the factory image.
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
Windows:
Code:
flash-all
Mac/Linux:
Code:
./flash-all.sh
Reboot once it is finished!
Rooting with Magisk
NOTE #4: This section assumes you are not going to install TWRP. If you are, skip to the next section and just flash the latest Magisk zip after installing TWRP.
Download the Magisk zip from the official thread and install the manager from the zip.
Grab a boot image to patch (either the one from the latest factory image or a custom kernel one) and push it to your device:
Code:
adb push <path_to_file> /sdcard/Download
Open Magisk Manager and click the Install button.
Click "Install" at the first prompt then choose "Patch Boot Image File". A file manager will pop up.
Select the boot image you want to patch and let Magisk Manager patch it.
Pull it off your device:
Code:
adb pull /sdcard/MagiskManager/patched_boot.img
Reboot into the bootloader:
Code:
adb reboot bootloader
Flash the boot image and reboot.
Code:
fastboot flash boot patched_boot.img
fastboot reboot
Open Magisk Manager and you should be rooted!
Installing TWRP
NOTE #5: If you just want to temporarily boot TWRP to flash Magisk and your custom kernel, you can just skip flashing the installer zip in this process.
NOTE #6: TWRP can be unstable at times given the way that security has been set up on this device (lack of decryption, failing to boot, etc).
Download both the TWRP image and zip installer from the official site.
Temporarily boot the TWRP image.
Code:
fastboot boot <path_to_twrp_image>
Flash the TWRP installer zip.
Reinstall Magisk and your custom kernel if you had them.
Reboot and profit!
Common issues
Outdated fastboot/adb: This device requires the latest fastboot and adb binaries to work properly. A lot of common quick adb/fastboot installation guides link to installers that are old. Please manually install the latest using the information at the beginning of the thread!
Using a USB-3.0 or USB-C port: Some newer USB ports do not work with fastboot. Issues manifest as weird errors during a flash. Use a different USB cable/port.
Closing statements
If there are any procedures you would like to see added (like flashing a custom kernel or booting TWRP), I am happy to add them if requested. Also, when requesting help, please be as specific as possible where you get confused. I want this guide to be clear as possible.
Reserved
Reserved
Stuck on this step
Run the flash all script! Open a command prompt, navigate to the folder with the script, and run one of the following commands:
How do I navigate in command prompt? When I typed flash-all, it said it is not a internal command etc. When I dragged and dropped flash-all into the command prompt, it said C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES>"C:\Users\****** Jim\Downloads\walleye-opd1.170816.025-factory-4752baae\walleye-opd1.170816.025\flash-all.bat"
error: cannot load 'bootloader-walleye-mw8998-002.0059.00.img'
rebooting into bootloader...
OKAY [ 0.004s]
finished. total time: 0.004s
error: cannot load 'radio-walleye-g8998-00122-1708311414.img'
rebooting into bootloader...
OKAY [ 0.010s]
finished. total time: 0.015s
W/ ( 6448): Unable to open 'image-walleye-opd1.170816.025.zip': No such file or directory
error: failed to open zip file 'image-walleye-opd1.170816.025.zip': I/O Error
Press any key to exit...
You are calling the flash-all.bat out of a differende directory (C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES) therefore it can't find the system image files since they are located under C:\U sers\****** Jim\Downloads\walleye-opd1.170816.025-factory-4752baae\walleye-opd1.170816.025. Make sure you extract your image to that directory, open up a command promt and navigate to it with "cd C:\Users\W Balls\Downloads\SAMPWND_SYSTEMROOT_ADB_FILES" and call the flash-all.bat from there.
Check out this for basic command line stuff https://www.digitalcitizen.life/command-prompt-how-use-basic-commands
---------- Post added at 10:58 AM ---------- Previous post was at 10:56 AM ----------
I tried this and it seems the magisk manager isn't able to download magisk on its own at least on my device:
Code:
DownloadManager: [356] Stop requested with status HTTP_DATA_ERROR: Unable to resolve host "forum.xda-developers.com": No address associated with hostname
DownloadManager: [356] Finished with status WAITING_TO_RETRY
EDIT: Seems like DNS66 was blocking the download patching was scucessfull now.
This is weird, can't I make 2 posts in a row??
Anybody figure out a solution for flashing when on MacOs High Sierra? Platform tools 26.0 1 was a fix for high Sierra, yet 26.0.2 seemed to have lost that commit, so fastboot doesn't work at all. Wondering if it's safe to use 26.0.1 on the pixel 2
nathanchance said:
Flashing factory images
Click to expand...
Click to collapse
First, thanks for putting this together. I've rooted using your method.
Regarding OTA updates: I've read that if we've rooted, we will need to un-root before we can receive an OTA update. Is this always true, or only if we've installed a custom recovery like TWRP? It would be really handy to have a guide on how to un-root, update, then re-root.
Related - let's say that for whatever reason, we have to flash an OTA update manually, rather than actually getting it OTA. Do we lose root by doing so?
Thanks!
JayBlack_686 said:
First, thanks for putting this together. I've rooted using your method.
Regarding OTA updates: I've read that if we've rooted, we will need to un-root before we can receive an OTA update. Is this always true, or only if we've installed a custom recovery like TWRP? It would be really handy to have a guide on how to un-root, update, then re-root.
Related - let's say that for whatever reason, we have to flash an OTA update manually, rather than actually getting it OTA. Do we lose root by doing so?
Thanks!
Click to expand...
Click to collapse
Magisk's OTA section should clear up some of your doubts: https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md#ota-installation-tips
nathanchance said:
Magisk's OTA section should clear up some of your doubts: https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md#ota-installation-tips
Click to expand...
Click to collapse
Looks really straightforward, thank you! Might be cool to point to it in the OP. I bet I'm not the only one who was only vaguely aware of the impact that rooting has on how we get OTAs. Then again, maybe everyone else wants to run custom ROMs.
JayBlack_686 said:
Looks really straightforward, thank you! Might be cool to point to it in the OP. I bet I'm not the only one who was only vaguely aware of the impact that rooting has on how we get OTAs. Then again, maybe everyone else wants to run custom ROMs.
Click to expand...
Click to collapse
Good point, I'll add it here in a bit
Sent from my Pixel 2 XL using XDA Labs
OTA vs factory image
Howdy,
really appreciate @nathanchance for putting this together. Would you mind adding a few lines about the differences between OTA and factory images. As a layman i haven't got the foggiest idea which route to go and would appreciate some wisdom. Thanks!
Thank you so much for this guide but can anybody please explain how you can tell which image to patch ?
I am unable to get this to work magisk is showing this message: stock kernel cannot be patched please use a custom kernel
i downloaded: walleye-opd1.170816.010-factory-63083164.zip
unsure as to whether this is correct for my phone as they are quite a few and its unclear how to tell
i have a pixel 2 from the UK that was factory unlocked and i unlocked the boot loader
what am i doing wrong please help
tango650 said:
Howdy,
really appreciate @nathanchance for putting this together. Would you mind adding a few lines about the differences between OTA and factory images. As a layman i haven't got the foggiest idea which route to go and would appreciate some wisdom. Thanks!
Click to expand...
Click to collapse
The primary difference is that the OTA can be flashed on an unlocked bootloader and is designed not to wipe your phone.
UpGrad3 said:
Thank you so much for this guide but can anybody please explain how you can tell which image to patch ?
I am unable to get this to work magisk is showing this message: stock kernel cannot be patched please use a custom kernel
i downloaded: walleye-opd1.170816.010-factory-63083164.zip
unsure as to whether this is correct for my phone as they are quite a few and its unclear how to tell
i have a pixel 2 from the UK that was factory unlocked and i unlocked the boot loader
what am i doing wrong please help
Click to expand...
Click to collapse
Are you supplying the boot image to Magisk? Show me a screenshot of what Magisk says when it tries to patch.
Thanks @nathanchance for this. I'm not a technical person, but can follow directions. This is the 4th phone that I've rooted following directions of some very smart and talented people here on XDA. I don't do this kind of thing everyday, and am not up on programming or coding or whatever you guys call it now days.
All I ended up doing is taking the OTA from Google to the .025. Then followed the Magisk rooting instructions to get root. I had Unlocked it the first day I turned the phone on, I haven't put my SIM in yet, but will play around with it a little more, and finish setting it up,
Again, thanks for the GUIDE to this Pixel 2 phone.
nathanchance said:
The primary difference is that the OTA can be flashed on an unlocked bootloader and is designed not to wipe your phone.
Are you supplying the boot image to Magisk? Show me a screenshot of what Magisk says when it tries to patch.
Click to expand...
Click to collapse
That is what i get. I have even flashed the whole factory image to the phone and still get this
@UpGrad3 you need to extract the boot.img out of your zip (walleye-opd1.170816.010-factory-63083164.zip) file and process this one, I'll guess you tried with the whole zip?? Also you can "attach" pictures to the post and not include the full res with the image tags...
@drmason I did extract the img from the zip. I followed the instructions exactly which is why im so confused as to what is going on ? Ok sorry i will do in future.
Amended post
UpGrad3 said:
@drmason I did extract the img from the zip. I followed the instructions exactly which is why im so confused as to what is going on ? Ok sorry i will do in future.
Amended post
Click to expand...
Click to collapse
You got the boot.img from the zip file that was inside the zip file?
from https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Step by step
1. Download and extract factory image. Mine was taimen-opd1.170816.010-factory-c796ddb4.zip
***2. Once extracted go into the folder and extract image-taimen-opd1.170816.010.zip.
There you will find the boot.img.
---------- Post added at 08:36 AM ---------- Previous post was at 08:27 AM ----------
nathanchance said:
Good point, I'll add it here in a bit
Sent from my Pixel 2 XL using XDA Labs
Click to expand...
Click to collapse
@nathanchance, one more suggestion for the OP: at one point I was looking at using the stock boot img and couldn't figure out how to get it. Later, I found the below post, where the first two steps are essentially "open the zip inside the zip for the boot.img" to extract the stock boot image. Maybe it's really obvious, but I didn't get it.
https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
@UpGrad3 you are using the latest Magisk Manager 5.4.1 for this?
JayBlack_686 said:
You got the boot.img from the zip file that was inside the zip file?
from https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Step by step
1. Download and extract factory image. Mine was taimen-opd1.170816.010-factory-c796ddb4.zip
***2. Once extracted go into the folder and extract image-taimen-opd1.170816.010.zip.
There you will find the boot.img.
---------- Post added at 08:36 AM ---------- Previous post was at 08:27 AM ----------
this is where i was going wrong i was using a file that had bootloader in the name rather than going into the second zip and finding boot
@nathanchance, one more suggestion for the OP: at one point I was looking at using the stock boot img and couldn't figure out how to get it. Later, I found the below post, where the first two steps are essentially "open the zip inside the zip for the boot.img" to extract the stock boot image. Maybe it's really obvious, but I didn't get it.
https://forum.xda-developers.com/showpost.php?p=74429474&postcount=90
Click to expand...
Click to collapse
drmason said:
@UpGrad3 you are using the latest Magisk Manager 5.4.1 for this?
Click to expand...
Click to collapse
yes i was
although im now stuck on the bootscreen with the G any suggestions ?
Fixed.
incase it happens to anyone else. i restored the factory image again then started the root procedure. im now rooted and fully working