The post has been updated to work with Android 9.0 P with the latest Magisk v16.1 systemless rooting tool. This post is a continuation of the detailed tutorial on rooting the Googel Pixel and Pixel 2 on the Oreo. Now that the most popular rooting tool called Magisk Manager has been updated to support Android 9.0 P, it can be used on Google Pixel devices.
If you have been following Android lately, then the latest Android P 9.0 Developer Preview version is available for download for the Google Pixel and Pixel 2 devices. We also have the new Android P launcher. Today, some of the most recognized Android developers topjohnwu, have released a full proof solution to root the newest Android P 9.0 version. We will keep updating the post with new versions. So stay tuned.
Moreover, the most awaited root and TWRP recoveries for the two new Google phones called the Pixel (sailfish) or Pixel XL (marlin) and the Pixel 2/XL are now available. This is a new beginning for Pixel users as well as the future for Android development as future updates will be related to the new Nougat OS. We have already seen that the Pixel phones now run on the latest Android 8.1 Oreo and there have been major changes to the Pixel’s core system including the partitions. Hence, it took awhile for the contributors to gain a stable root access and build a custom TWRP recovery for the Google Pixel (2).
This guide not only explores rooting Android P, 8.1 Oreo, 7.1 Nougat or earlier version on various devices, but also explored all the details on rooting Google Pixel devices with multiple partitions. We know Google Pixel and some other devices come with A/B partitions. We will be going through the complete root procedure for your Pixel and Pixel 2 with A/B partitions as well. The rooting procedure includes unlocking the Bootloader, installing the TWRP recovery, and flashing latest Magisk zip.
Warning and notes: Unlocking bootloader, rooting, or installing TWRP may void your device’s warranty. Even though the instructions provided below have been tested on other devices, you should still be cautious about it. Readers discretion is advised.
Requirements to root Android P
Currently, Android P is only available for Google Pixel. So we have updated the post in consideration that you have a Google Pixel or Pixel 2 device. Stay tuned for further update.
- Enable Developer options. To do so, go to Settings> About Phone> Tap on the Build Number several times until you get a new Developer Options in the Settings.
- Now go to Settings>Developer Options and Enable OEM Unlock. This is an important step. Otherwise, the fastboot commands won’t work.
- Enable USB Debugging and Advanced Reboot on your device. Open Developer Options and enable USB Debugging from there. Trust the connection by allowing it when you connect it to your PC for the first time.
- Install quick ADB and Fastboot drivers on your PC. Download the quick ADB Installer for Windows, Mac OS, Linux, and Chrome OS.
- Make sure you have latest device drivers setup on your PC for a better connection. Get it from the official page of Google.
How to Unlock Bootloader On any phone running Android P 9.0 or earlier?
Unlocking Bootloader leads to factory reset! So backup! The first step towards Android development on your smartphone is to unlock the Bootloader. This unlocks various developmental features on your phone. It basically enables you to access and modify core system files.
Following bootloader unlock, you will need to setup TWRP recovery, and flash magisk zip using TWRP. The new Magisk 16.1+ will root your device. The procedure is only for the international or global variants of the Google Pixel (2).
Google Pixel Android P Bootloader Unlock method
Step 1: Connect your Android device to the PC and trust the connection- tap Yes on “Always allow from this computer” when you plug in the device into PC for the first time.
Step 2: If you have installed the quick ADB installer, launch a command prompt or terminal window anywhere. To do so, just click the address bar and type cmd and press Enter key or hold the shift key on the keyboard and right-click on an empty space and select “Open command window here” option to launch a cmd window.
Step 3: Now reboot into the bootloader, issue the following commands. (If ADB does not detect your device try switching your phone’s USB mode from Charging to MTP or PTP.)
adb reboot bootloader
Step 4: Once in the bootloader, issue the following fastboot command to unlock the bootloader.
fastboot flashing unlock
Note: The above code in only for the Google Pixel, Pixel 2, and Nexus 6P devices. For other devices, use the following code to unlock bootloader:
fastboot oem unlock
Step 5: Once you get to the unlock confirmation screen on your Android device, Press Volume Up button and hit the Power button to select it. Your bootloader unlocking process will begin may take a couple of minutes.
Step 6: Once the bootloader has been unlocked, your device will reboot. If it gets into bootloader mode again, reboot into system by issuing the following command:
You may now proceed TWRP installation.
How to install TWRP and Root Google Pixel (2) on Android P?
Note: The following method is for Google Pixel and Pixel 2 running Android P, 8.1 Oreo, or earlier. For detailed tutorial on how to install TWRP on any other Android phone, visit the following tutorials:
- How to install TWRP on any Android device?
- How to install TWRP on Samsung Galaxy devices using Odin?
Do not proceed unless you have unlocked the Bootloader! Also, do not use it for multiple users including a guest account. Do not proceed if you have important stuff and critical data on your phone that cannot be lost.
The procedure is similar to installing TWRP on most other Android phones. However, due to A/B partitioning present in Google Pixel and Pixel 2 devices, Fastboot commands have changed a little. To install TWRP, first, we will be booting the TWRP image and then flash the TWRP zip.
TWRP installation method:
Note: If you accidentally flash TWRP to your device using Fastboot instead of temporarily booting the image, you will need to download the latest factory image for your device and re-flash the boot image.
Step 1: Download the TWRP recovery and latest Magisk zip file from above. Download both – the TWRP file with .
.img extensions. You will need both. You don’t need to extract the files, just transfer all the files to your PC.
Step 2: Setup quick ADB and Fastboot Installer on your PC and go through all the prerequisites from above.
Step 3: Now plug in the Google Pixel device to your computer and open a command prompt or terminal window on your PC within the folder where
TWRP.zip file is located. (See above to know how to open cmd).
Step 4: Reboot your Android device into the bootloader or Fastboot mode. To do so, issue the following command through cmd or terminal. You can also manually boot into it using the hard key combination like Power+Volume Down while the device is turned off. Meanwhile, use code:
adb reboot bootloader
Step 5: Now issue the following command in the command prompt to check your device connectivity.
Step 6: Now issue the following command to temporarily boot up the TWRP image.
fastboot boot twrp.img
Note: If you have installed the quick 15 second ADB & fastboot installer, simply enter the folder where the TWRP zip file is present and issue command. Otherwise, you will need to enter the directory path name like “fastboot boot path/to/twrp.img”. Alternatively, while, on Mac OS, you can issue “./fastboot boot path/to/twrp.img” command or on Linux type “sudo fastboot path/to/twrp.img” to flash the TWRP.
Step 7: Once your device Reboots into the temporary TWRP recovery, use the TWRP interface to flash the recovery zip. Navigate to install and select
Root Android P 9.0 with latest Magisk 16.1+
Once you install TWRP, it’s time to root.
- Transfer latest Magisk v16.1 package to Android device’s internal storage or SDcard.
- Reboot your phone into the custom TWRP recovery. For that, turn off your device completely and hold volume down and power buttons for a few seconds.
- From TWRP, tap the install button and select the SuperSU file.
- Swipe the confirmation action below to start flashing.
- Once done. Reboot to system.
You can boot into the TWRP recovery by issuing the following command:
adb reboot recovery
Follow and like us on social media. For queries either comment down below.
Subscribe to Newsletters via Email. Follow us on Google News and Join our Telegram Group! Also, support us by donating via PayPal.