Android has come a long way and – for many functions – root access to the operating system is not required any more but for some out there this isn’t enough. Some want to have that extra bit of control and allow apps to perform functions not possible without superuser access. A developer over at XDA has written a basic how-to guide on rooting your Pixel 2 and in the usual Ausdroid tradition we have decided to simplify it even further for you.
For the purpose of this article I am going to assume you have ADB and Fastboot installed on your computer. If you don’t already have them install I am NOT going to tell you how to do it. Go and read. The more you know about them and how to use them the better. I discourage you from “learning” about them using a toolkit/toolbox: there has been a multitude of times where people have asked me to help them recover from a soft brick and it was extremely difficult because they did not understand the basic ADB and Fastboot commands.
If you learn yourself you will be able to not just have a lot of fun hacking your phone but also be able to recover from any issues you may have (and that WILL happen eventually). A search of ADB and Fastboot on XDA is a good start.
The Pixel 2 and the Pixel 2 XL have different bootloader unlock commands for this purpose. This year LG/Google have introduced a new command used to unlock the bootloader of the Pixel 2 XL — not the Pixel 2 though.
fastboot flashing unlock_critical
Remember that unlocking your bootloader wipes your phone so I encourage you to make sure everything is backed up before continuing. After you have your ADB and Fastboot tools installed and functional (I prefer to add them to environmental variables in windows so they work from everywhere on the PC and not just the Fastboot folder) you will need to prepare your phone for the unlocking:
- Open the Settings app on your phone and navigate to About Phone to unlock the Developer Options by tapping on the Build Number seven times.
- Go back one level on the Settings app and enter the Developer Options.
- Move the slider to turn on USB Debugging and OEM unlocking
- Open up a CMD prompt on your PC — the old school variety, not the new Powershell — and type:
adb reboot bootloader
The phone will then boot into the bootloader which is where you will unlock the bootloader. From here you type in the unlocking codes. If you have a Pixel 2 you use the first command (fastboot flashing unlock) and if you have a Pixel 2 XL you use the second command with the unlock_critical option. The difference between the two is that one will allow you to directly flash new and updated bootloaders should they arrive from Google and one won’t. You should always have the most up-to-date, secure bootloader possible so I recommend using the unlock_critical option which allows you to flash updated bootloaders in the future.
fastboot flashing unlock
fastboot flashing unlock_critical
The phone will then prompt you to unlock and after following the prompt the phone will reboot. The reboot may take a while so be patient while it reboots. Once it has rebooted it is now time to obtain root access on your phone.
The most commonly-used root method on Pixel phones these days is Magisk and Magisk Manager. Magisk is an app and a solution to root your phone with an unlocked bootloader that still allows your phone to pass the Google SafetyNet check.
- Head over to the Magisk XDA Pixel 2 thread and download the Magisk Manager app and install it.
- Next you can modify a standard boot image or a custom boot image of your choosing. I suggest at this stage you use the basic stock boot image which you can extract from the latest factory image.
- Pop this onto your phone’s storage (sd card) using either ADB or the file explorer of your computer.
- Open the Magisk Manager app and hit Install followed by Patch Boot Image File
- Choose the boot image you want to patch from the file manager that pops up (this is where you choose either the stock boot image or a custom one).
- Magisk Manager will then patch the boot image and save it into it’s directory
- You will need to pull that image from your sd card using either ADB or the PC file manager as you will need to flash this boot image in the bootloader to complete the process. The ADB command to pull it is:
adb pull /sdcard/MagiskManager/patched_boot.img
- Now you will need to enter the bootloader again:
abd reboot bootloader
- When in the bootloader flash the patched boot image and then reboot the phone using the following commands:
fastboot flash boot patched_boot.img
Once your phone reboots it should be rooted. Open Magisk Manager to check. Within Magisk Manager you can control the entire root process and after having used it fairly extensively on my Pixel XL, I highly recommend you test out all it’s functions.
At this stage we have not tested this ourselves (as I do not have one…. yet) but will be tested early this week. Feedback on XDA is that it works well if you follow the steps closely and carefully. Remember if you do mess something up just flash the factory image again.
Ed. Chris might try this if he gets bored.