Thanks to XDA developer TopJohnWu, he has released Magisk V16.1 which now’s fully compatible with the newest Android P(9.0) so you’ll easily root your Pixel phones on the latest Android P Preview and may work fine when official Android P comes out. Let’s refer to how to root Android Pie (9.0) below:
IMPORTANT NOTE: These original instructions assume that you have just unlocked your bootloader !!! If you haven’t unlocked the bootloader, follow steps 1 through 13 in our original Pixel 2 root guide (works for both Pixel / Pixel 2).
This root method is for the following Pixel models:
- Pixel XL
- Pixel 2
- Pixel 2XL
How to Root Android Pie(9.0)! [Pixel/Pixel XL/Pixel 2/Pixel 2XL]
Step 1. Remove your security locks like fingerprint or PIN and set screen lock to “swipe” or “none”. You’ll be able to re-add these later after rooting. We try this so TWRP doesn’t must decrypt your phone.
Step 2. Connect your Pixel to your computer and set “File Transfer” ON so you’ll be able to transfer files to that from your computer.
Step 3. Download the newest TWRP from TWRP.me for YOUR model of Pixel.
Grab both the IMAGE(file ending in img) and therefore the INSTALLER(file ending in zip). Attempt to get the most recent version so you get the most recent version of TWRP.
Step 4. Also download Windows drivers(no drivers needed for Mac or Linux), fastboot.zip, and Magisk.
Download Magisk(UPDATED: Use Magisk v16.7 for Android P 9.0 Official)
Unzip the Windows driver and fastboot zip files, you must get two new folders.
Step 5. Copy and paste the TWRP IMAGE file into the fastboot folder.
Step 6. Copy the Magisk and TWRP ZIP file over to your Pixel.
Step 7. Power off your Pixel, then hold down Volume Down and therefore the Power buttons together for about 5 seconds until you enter the bootloader mode.
The device state should read “unlocked”, which suggests you have got unlocked your bootloader.
Connect a USB cable from your Pixel to your computer.
Step 8. If using Windows, install the drivers.
Step 9. Next, open an electronic communication for Windows(or terminal for Mac/Linux) and type:
*Note: Replace “xxx” below with the particular filename as every Pixel model uses different file names together with different TWRP versions within the file name.
fastboot boot twrp-xxx.img
chmod 755 *
./fastboot-mac boot twrp-xxx.img
chmod 755 *
sudo ./fastboot-linux boot twrp-xxx.img
Since Pixel now not incorporates a separate recovery partition, doing above will boot you into TWRP temporarily.
Step 10. Once in TWRP recovery, install the TWRP ZIP file so you’ll install it permanently. Also, after you install a brand new ROM or firmware, you may need to flash this TWRP ZIP file so keep it handy for the subsequent time you put in a brand new ROM.
You can use the reboot menu to reboot into recovery and check your TWRP is now permanent.
Step 11. Next, install the Magisk ZIP file.
Step 12. After reboot, you have to find the Magisk application in your application drawer. Run it and if you see a green checkmark next to the installed version, you’re completely rooted!
Verify you’ve got full root by installing a free Titanium Backup app on the Play Store. If you see a Superuser request window like below, you’re GOOD TO GO! Pat yourself on the rear and swank to your friends as you’ve got the most recent Android software together with root!!!
Refer: How to root Android 10