[GUIDE] Unlock/Flash/Root for the Pixel 2 XL (taimen)

Search This thread

CPngN

Senior Member
Apr 18, 2012
151
29
Bay Area, Ca
Not sure why you're quoting my post to say this. I was trying to put him on the right track to flash everything manually. I never suggested any script except for Google's own flash-all. Unfortunately, I haven't had the chance to go this process myself on taimen, which is why I suggested in an earlier post that someone else might chime in with a full list of commands.

Yes, again sorry, I wasn't going after you directly, it just made me realize that a lot of people quote that script as if it were big and complicated, and it's just 3 individual flash commands in a row with some reboots, pauses, and comments. It would be nice if folks would just post those inline with their other instructions so the user could watch each one and verify that it didn't fail before rebooting bootloader and moving on. Not likely to matter when things are done right and there's no corruption or glitches, but it helps to be a little cautious and avoid making things worse! Anyway, thanks for helping, carry on! :)

---------- Post added at 07:56 AM ---------- Previous post was at 07:32 AM ----------

Yes, I have my bootloader entirely unlocked. I'm not sure what the underlying issue was, but I used my functioning twrp to do a factory reset and then just went through the same steps to root etc. It's working now, so that's good!! Also, it seems to be a common issue when trying to run the script on Mac, I remember seeing on Google that this happened to many others. Thank you for the reply though!

From what I recall reading, that is mainly because people do not set their adb up to be executable from anywhere. The recommended method to get the latest install probably does not update your PATH to add a path to adb and fastboot. Since the script just calls "fastboot" but does not have the full path (/usr/local/bin/fastboot usually), it will fail unless you make the hacky move of copying your files to the adb folder and running it from there. You'll see people also have to modify the commands to add "./" in front to tell it to run from the current directory. All of this is solved by a proper installation where /usr/local/bin is added to your PATH. For most folks, they are using the 'bash' shell, and can fix this in FUTURE sessions by adding this to ~/.bashrc:

Code:
 export PATH='$PATH:/usr/local/bin/:~/bin'

(That will also add your own personal bin folder to your path - a good place to put your custom scripts if you ever have any, and harmless if you don't.)
You can also run that directly on the command line to fix the current session.
If you put your adb and fastboot somewhere "strange", you can find them again the brute-force way by scanning the drive:
Code:
find / -type f -name "fastboot*" -ls
The files in /usr/local/bin/ are often links to a longer, uglier install base. If you use homebrew on the Mac to install adb (brew install android-platform-tools), they link like this:
/usr/local/bin/fastboot -> /usr/local/Caskroom/android-platform-tools/27.0.1/platform-tools/fastboot
 
  • Like
Reactions: steviewunderr

jrbxx7

Inactive Recognized Contributor
Nov 18, 2011
3,252
3,488
Why is everyone so hung up on this script? it's just a script. A dangerous script, as it does not pause to give the user a chance to examine each run. All it does is this, and you're better off running these commands 1 at a time manually:
fastboot flash bootloader bootloader-taimen-tmz12bb.img
fastboot reboot-bootloader

fastboot flash radio radio-taimen-g8998-00164-1710262031.img
fastboot reboot-bootloader

fastboot update image-taimen-opm1.171019.021.zip

(Example for flash-all.sh from March update for Pixel 2 XL)

Sorry, not trying to attack anyone, but people seem to be hung up on this script as if it were hundreds of lines long and full of checks and balances, and it's not. It's beyond basic, to a fault. The "sleep 5" that is in between commands would better replaced by a pause/wait-for-user-to-hit-enter command to make sure you can validate there were no errors before rebooting.


Lolol yes the script from the manufacturer is very dangerous... Running it on every update has ruined my phone. The log shows everything as it runs including errors...
 

ryknow27

Senior Member
Oct 19, 2009
274
35
This may be a stupid question but I am on Verizon and I saw that Best Buy has Verizon Pixel 2 XLs that are unlocked and can be used on any carrier. If I buy one from there would I be able to unlock the bootloader as stated in the OP or can you only unlock the bootloader on ones from the Google store? :confused:
 

Az Biker

Senior Moderator / RC- RT Committee / Semper Salty
Staff member
This may be a stupid question but I am on Verizon and I saw that Best Buy has Verizon Pixel 2 XLs that are unlocked and can be used on any carrier. If I buy one from there would I be able to unlock the bootloader as stated in the OP or can you only unlock the bootloader on ones from the Google store? :confused:

For use on any carrier is not the same as unlockable bootloader IIRC.

You want to get the Google version, which is good for any carrier,and has the unlocked bootloader.
 
  • Like
Reactions: ryknow27

sirxdroid

Senior Member
Nov 21, 2012
2,022
570
This may be a stupid question but I am on Verizon and I saw that Best Buy has Verizon Pixel 2 XLs that are unlocked and can be used on any carrier. If I buy one from there would I be able to unlock the bootloader as stated in the OP or can you only unlock the bootloader on ones from the Google store? :confused:

If you care about unlocking the bootloader, do NOT buy the Verizon version.
 
  • Like
Reactions: ryknow27

Badger50

Forum Moderator
Staff member
Feb 27, 2011
11,701
11,123
61
Kansas City
Samsung Galaxy Tab 7.7
So I just unlocked my phone, and fastbooted twrp img, terminal says successful. But the phone vibrates and the Google logo appeared for a second, and goes back to bootloader. how com it won't flash to twrp

I'm assuming you used the command...fastboot boot twrpxxxxxx.img. If so, then check to make sure your SDK platform-tools is up to date, maybe try a different USB cable and port, and you do have the twrp.img in your platform-tools folder correct?

---------- Post added at 03:22 PM ---------- Previous post was at 03:20 PM ----------

Also, I'm assuming that the toolkit unlocked the _critical partition as well. You can check by running...fastboot getvar all.... to check the status of your bootloader and slot your on.
 
  • Like
Reactions: 93fuelslut

93fuelslut

Senior Member
Jul 1, 2012
2,932
441
Nexus 6
I'm assuming you used the command...fastboot boot twrpxxxxxx.img. If so, then check to make sure your SDK platform-tools is up to date, maybe try a different USB cable and port, and you do have the twrp.img in your platform-tools folder correct?

---------- Post added at 03:22 PM ---------- Previous post was at 03:20 PM ----------

Also, I'm assuming that the toolkit unlocked the _critical partition as well. You can check by running...fastboot getvar all.... to check the status of your bootloader and slot your on.
Dude thank you for the info on the fast boot command getvar. I didn't know that. I just deleted the twrp img file and redownloaded it. That solved it, or me using an older twrp img
 

93fuelslut

Senior Member
Jul 1, 2012
2,932
441
Nexus 6
I'm assuming you used the command...fastboot boot twrpxxxxxx.img. If so, then check to make sure your SDK platform-tools is up to date, maybe try a different USB cable and port, and you do have the twrp.img in your platform-tools folder correct?

---------- Post added at 03:22 PM ---------- Previous post was at 03:20 PM ----------

Also, I'm assuming that the toolkit unlocked the _critical partition as well. You can check by running...fastboot getvar all.... to check the status of your bootloader and slot your on.

So I entered the command, but I don't know what to look for. I don't see anything about unlocked critical or anything
 

Attachments

  • IMG_20180317_142851.jpg
    IMG_20180317_142851.jpg
    264.4 KB · Views: 170

Badger50

Forum Moderator
Staff member
Feb 27, 2011
11,701
11,123
61
Kansas City
Samsung Galaxy Tab 7.7
So I entered the command, but I don't know what to look for. I don't see anything about unlocked critical or anything

Your unlocked. However, if you want to make sure, run the command...fastboot flashing unlock_critical.......be advised, if the toolkit didn't perform this, it WILL wipe your phone!! If it was performed by the toolkit, you'll just get a message that says already unlocked. Tough choice I know :eek:
 
  • Like
Reactions: 93fuelslut

93fuelslut

Senior Member
Jul 1, 2012
2,932
441
Nexus 6
Your unlocked. However, if you want to make sure, run the command...fastboot flashing unlock_critical.......be advised, if the toolkit didn't perform this, it WILL wipe your phone!! If it was performed by the toolkit, you'll just get a message that says already unlocked. Tough choice I know :eek:
Yeah it wiped everything. But I just didn't know how to read all that to see if I was unlocked or critical unlocked. But all seems to be well since I just flashed nitrogen. Thanks again
 

Az Biker

Senior Moderator / RC- RT Committee / Semper Salty
Staff member
When you reboot your phone and the message says your vendor doesn't match, does that actually hinder your service and anyway

It's super easy to fix.

Just unzip the factory image, then unzip the second zip and copy the vendor.img file to your sdcard, boot into TWRP and flash that bad boy to the Vendor partition and reboot... no more message.

It's happened to me on the last two DU updates, so now I just leave the vendor image in my "to be flashed" folder on my sdcard. Just remember that the vendor must come from the same month the OS or cust Rom your flashing does (ie: the latest DU is MARCH security, so I used the MARCH vendor from the factory image file)
 

Wartickler

Senior Member
Nov 4, 2009
170
353
Tallahassee, FL
Having rooted and flashed many devices over the years I've been through many types of root management tools. Magisk seems to be yet another new flavor of root management. If I don't care about passing SafetyNet must I go through the hoops of Magisk or are there simpler root management schemes? Do any of the old tools work on 2XL? Searching doesn't seem to lead me anywhere but Magisk.
 

galaxys

Recognized Contributor
May 9, 2007
13,185
2,631
Cosmos
Smart Watches
OnePlus 8 Pro
Having rooted and flashed many devices over the years I've been through many types of root management tools. Magisk seems to be yet another new flavor of root management. If I don't care about passing SafetyNet must I go through the hoops of Magisk or are there simpler root management schemes? Do any of the old tools work on 2XL? Searching doesn't seem to lead me anywhere but Magisk.

Magisk is it for now. It takes some getting used to, but works a treat!
 
  • Like
Reactions: BIGWORM

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Will this work on any carrier brand of pixel 2 xl?
    All except Verizon issued phones.
  • 203
    Introduction

    Hello everyone, this is a guide to assist you with customizing your Pixel 2 XL! 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.


    Windows:

    1. Unzip the folder somewhere on your hard drive.
    2. Go to the folder containing the adb and fastboot files and type "cmd" in the path bar at the top.
    3. A command prompt should open with the current folder showing on the prompt.
    4. 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:

    1. Unzip the folder somewhere on your hard drive.
    2. Navigate to that folder with your terminal.
    3. 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
    4. 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.

    1. On your phone, open Settings, navigate to "System" then "About phone", and tap on the build number 7 times.
    2. Go one menu up, click on "Developer options", and turn on USB debugging and OEM unlocking.
    3. In your terminal, type the following command:
      Code:
      adb reboot bootloader
    4. Next, decide if you want to do a standard unlock or critical unlock. A critical unlock allows you to directly flash bootloader files, otherwise you will get an error when you try to do so.
    5. Depending on what you decided in the previous step, run the following commands:
      Code:
      fastboot flashing unlock
      (OPTIONAL)
      Code:
      fastboot flashing unlock_critical
    6. Follow the prompts on your device then reboot!


    Flashing factory images

    NOTE #1: 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 #2: 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):

    1. Download the latest factory image from Google's website.
    2. Reboot into the bootloader:
      Code:
      adb reboot bootloader
    3. Unzip the factory image.
    4. Inside you will see a bootloader image, a radio image, an image zip file, and a couple of flash scripts.
    5. 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.
    6. Remove the "-w" flag before the fastboot command towards the end of the file. This will prevent fastboot from formatting your device.
    7. 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
    8. Reboot once it is finished!
    Updating to a new release (OTA zip):

    1. Download the latest OTA zip from Google's website
    2. Reboot into recovery:
      Code:
      adb reboot recovery
    3. Hold down the power button and push volume up
    4. Select "Apply update from ADB"
    5. Run the following command from the folder containing the OTA zip:
      Code:
      adb sideload <zip_name>.zip
    6. Reboot once it is finished!
    Clean flashing a factory image (wipe everything):

    1. Download the latest factory image from Google's website
    2. Reboot into the bootloader:
      Code:
      adb reboot bootloader
    3. Unzip the factory image.
    4. 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
    5. 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.

    1. Download the Magisk zip from the official thread and install the manager from the zip.
    2. 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
    3. Open Magisk Manager and click the Install button.
    4. Click "Install" at the first prompt then choose "Patch Boot Image File". A file manager will pop up.
    5. Select the boot image you want to patch and let Magisk Manager patch it.
    6. Pull it off your device:
      Code:
      adb pull /sdcard/MagiskManager/patched_boot.img
    7. Reboot into the bootloader:
      Code:
      adb reboot bootloader
    8. Flash the boot image and reboot.
      Code:
      fastboot flash boot patched_boot.img
      fastboot reboot
    9. 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.
    43
    Upgrade to 8.1, TWRP, Magisk, and Cust Kernel (easy steps)

    After running through a bunch of threads, this is how I just upgraded to 8.1 with no issues,and all the steps and links in one post :D Everything works.

    My Previous Setup:
    Bootloader (unlocked and critical_unlocked) (SEE OP FOR UNLOCKING BOOTLOADER INSTRUCTIONS)
    Nov 8.0 Google factory image
    Magisk 14.6
    TWRP 3.2.1.0

    prep work:
    -in developer option make sure OEM unlocking is ON
    -in developer options make sure USB Debugging is ON
    -have the latest SDK toolkit (download in OP)
    -have a 2.0 USB in case your 3.0 USB doesn't work properly
    -Reboot PC, change between 2.0 and 3.0 cables, and change USB ports if having trouble using fastboot
    -make sure all the files you are going to fastboot are located IN the (platform tools folder that contains the fastboot application)

    * * * until TWRP fixes the security issue, REMOVE ALL SECURITY BEFORE USING TWRP, reactivate security after rebooting * * *

    *download Latest Google Taimen factory image
    follow Updating to a new release (factory image): in OP (DON'T perform flash-all yet, do that later)
    * put TWRP 3.2.1-2 IMG file IN the (platform tools folder that contains the fastboot application), for flashing in fastboot
    * put TWRP 3.2.1-2 ZIP in sdcard, for istalling in TWRP
    * put Flash's Cust 8.1.0 kernel 8.1 ZIP in sdcard for installing in TWRP *OPTIONAL*
    * put (Magisk latest version) in sdcard for installing in TWRP... Magisk Manager is built into latest Magisk version

    ***If you're planning on wiping your entire device (leaving the -w intact), put all the "sdcard files" on your PC, after first boot with fresh, factory image, use your favorite root explorer app and add a folder within the sdcard folder (I name mine TO BE FLASHED) and move all the 'sdcard files' files from your PC to here for flashing in TWRP ***

    Verify you're connected to PC and Fastboot:

    Open a COMMAND PROMPT (type CMD in the address bar) from the same platform tools folder on your PC where the fastboot application is located, and unzipped factory image files (including flash-all.bat) are located, do the following:

    type- fastboot devices (should see a serial number, this means you're good)

    type- flash-all (this flashes Latest Google Taimen factory image), let it do its thing... (removing the -w [see "updating a new release" in PREP above] stops this from wiping your phone, be sure to SAVE the file after removing the -w... leaving the -w in flash-all.bat, wipes entire device)

    -IF TWRP is NOT already installed:
    Boot into TWRP using fastboot
    (use TWRP IMG file placed in platform tools folder)
    fastboot boot <twrp filename.img >

    Permanently install TWRP OR to update latest TWRP .ZIP: ( Or SKIP this step if you do NOT want TWRP perm installed)
    flash TWRP zip
    (from within TWRP choose INSTALL and find the TWRP.ZIP file placed on your sdcard)

    reboot to TWRP
    (deselect install TWRP app, reboot back into TWRP)

    flash Flash kernel via TWRP
    (placed in sdcard, INSTALL in TWRP, be sure to use the ZIP version, if you use the IMG version you have to reinstall TWRP zip AFTER installing the kernel)

    flash Magisk zip via TWRP
    (placed in sdcard, and it will automatically install Magisk Manager)

    NOTE: Once Magisk is installed, install new versions by clicking INSTALL within Magisk Manager, use "DIRECT" method (for latest version switch channel in manager to BETA)

    reboot system
    profit!

    After reboot:

    If you get stuck at "G" screen at boot up, long press power button / hard reboot, should boot normal.

    When you see this message on boot up "The bootloader is unlocked and software integrity cannot be guaranteed..........." it is normal an has no effect on your device.

    SafetyNet PASSES
    15
    The two most tiring discussions to me are:

    1. Which or all of the unlock commands should I use?

    and

    2. How can I appease my ridiculous, pointless, almost hospital admittance worthy ocd of the absolutely insignificant vendor error pop-up message at boot that pops up only at reboot? because it causes me such distress that I will keep asking and discussing it ad nauseam since it's the most significant issue on our device right now. Please help


    1. Just run them all, in any order, fastboot will tell you if you need to run them in a certain order. And yes your data will be wiped, get over it and act like an adult.

    And

    2. stay on stock, please for the love of the android gods just please. I spend 5 hours trying to fix why sepolicy for taimen causes a kernel panic when trying to boot a custom rom. I get overcome with joy when I see the pop up because I know ive booted the rom. You popup-fear mongering folks offend me.

    Just I'm mostly kinda saying this in a light hearted, jestful manner, except for number 2.

    But seriously run all the unlock commands, Just unlock, unlock the crap out of it.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone