Earlier Google Launched its new flagship phones Pixel 2 and Pixel 2 XL with Android Oreo straight from the box. It was a good thing for the user but it was also a headache for advanced users and developers as these device can’t be easily root because of A/B partition system introduced in Android Nought.
Here’s a simple guide from xda to help you….
- If you are a newbie than Follow this detailed guide to install Fastboot and ADB.
- 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.
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.
[Also Read: Install Android O in Nexus Devices]
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 Installbutton.
- 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.
Now all the possibilities of Android are unlocked for you. Enjoy.
[Source : xda-devlopers]