Last night, the devs behind TWRP (specifically, Dees_troy) finally released an alpha version of the custom recovery for the Pixel devices. Now we can finally start to get ROMs for our precious made by Google phones. The only issue is that, with the new and complex nature of Android file system, there is a specific way to go about installing TWRP and maintaining root.
The following steps will be instructed as if you already know how to navigate ADB, fastboot, and command line/terminal at least enough to root. The first thing you’ll want to do is reflash the stock boot image if you have already rooted your device. To do so, run this code:
fastboot flash boot_a /path/to/boot.img
fastboot flash boot_b /path/to/boot.img
If you choose not to do this, be aware that you are risking a device stuck in bootloops or causing your device to only boot into recovery or Android.
Next, you’ll want to have all the files downloaded from Dees_Troy’s Google+ post, which include both the TWRP img and the supersu.zip files. From there:
fastboot boot /path/to/twrp.img
TWRP install twrp.zip
reboot into recovery
TWRP install supersu.zip
From there, you will have custom recovery TWRP installed on your device along with full root. A couple of other things to note are 1) ‘suhide’, which is an app used to make other apps not notice a rooted device, does not work on Pixels and 2) the ‘full unroot’ option within the superuser app will not remove TWRP from your device.
If you follow the steps I’ve outlined above then you’ll have a fully functioning Pixel that you can flash custom ROMs, kernels, etc. without having to worry about bootloops of cause for any other concern. Let us know any cool root mods that you find.Source: XDA Developers