How to Unlock Bootloader and Root the Google Pixel 2 and Pixel 2 XL
Many enthusiasts expected that achieving root on the first-generation Google Pixel would be just as easy as rooting Google’s Nexus devices, but that didn’t turn out to be the case. Android Nougat‘s A/B partition system created a lot of headache for developers in the beginning, and the Pixel’s incompatibility with the most common exploits only added to challenge. Needless to say, there was reason to worry about Pixel 2 and the Pixel 2 XL. But luckily, development seems to be moving along just fine.
In late October, an alpha port of TWRP was made available for the Pixel 2 and Pixel 2 XL. And this week, XDA Recognized Developer / Recognized Contributor nathanchance has released guides to unlocking, flashing, and rooting both phones.
Here’s how to get started:
- Unzip the folder 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:
adb --version fastboot --version
At this point, you should see some information appear. If that is the case, Fastboot and ADB have been successfully installed.
Unlock the bootloader of the Pixel 2 / Pixel 2 XL
The guide notes that unlocking your Pixel 2 or Pixel 2 XL’s bootloader will wipe the phone. It’s a good idea to make a backup of any important data in case something goes wrong.
- On your phone, open Settings, navigate to System then About phone, and tap on the build number seven times.
- The Developer Options will now be visible in the main settings page. Enter it and turn on USB debugging and OEM unlocking.
- Plug your phone into your computer, and type the following command in the Windows command terminal:
adb reboot bootloader
- 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.
- Depending on what you decided in the previous step, run one of the following commands:
fastboot flashing unlock
fastboot flashing unlock_critical
- Follow the prompts on your device, and then reboot.
Root the Pixel 2 / Pixel 2 XL
- Download Magisk Manager from the official thread and install it.
- Grab a boot image to patch (you can choose either the one from the latest factory image or a custom kernel one) and push it to your device with this command:
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 with this command:
adb pull /sdcard/MagiskManager/patched_boot.img
- Reboot into the bootloader:
adb reboot bootloader
- Flash the boot image and reboot.Code:
fastboot flash boot patched_boot.img fastboot reboot
- Open Magisk Manager and your device should be rooted.
Check out the respective forum threads for the Pixel 2 and Pixel 2 XL for tips on unlocking, flashing factory images, and rooting.