[Google Pixel XL Questions & Answers] crazykas:
1)Enable Developer Options

2)Enable OEM Unlock Bootloader and USB Debugging

3)Boot into bootloader

4)unlock boot loader (use command “fastboot flashing unlock) and it's permanent

5)Download latest factory image downloaded from Google and unzip it into your adb platform-tool path

6)Boot into bootloader>use command “fastboot --set-active=b”>now click on “flash-all.bat” in your adb platform-tool path>let it reboot.

6) Do not set your device, just reboot it back to bootloader> use command “fastboot --set-active=a”>now click on “flash-all.bat” in your adb platform-tool path>let it reboot.

5)To flash TWRP download “twrp-3.2.0-0-marlin.img” and “twrp-pixel-installer-marlin-3.2.0-0.zip” because as far as I know, twrp 3.2.1 has some decrypting issue. Download them and put “twrp-3.2.0-0-marlin.img” into your pc adb platform-tool path and move “twrp-pixel-installer-marlin-3.2.0-0.zip” to internal memory on your phone

6)Boot into bootloader>use command “fastboot boot twrp-3.2.0-0-marlin.img” (this ONLY boots TWRP). In TWRP locate and flash “twrp-pixel-installer-marlin-3.2.0-0.zip”

7)Boot in to system and remove your screen lock if you have set up any

8)Download the custom ROM of your choice and compatible GApps and move them in to internal memory on your phone.

9)Boot in to recovery and do a “factory reset” via TWRP> flash custom ROM>flash “twrp-pixel-installer-marlin-3.2.0-0.zip”>boot in to system (do not set up screen lock)

10)Boot in to recovery and flash GApps and Magisk 15.2 via TWRP>boot in to system

Please be noted this is for stock based ROMs only. If you to flash AOSP based rom follow this guide after step 9.Please be noted below guide taken from this ROM thread https://xdaforums.com/pixel-xl/development/rom-lineageos-15-1-pixel-xl-marlin-t3725985 and credits goes to "razorloves"

Download latest vender.img (same one in latest factory images).

Flashing Lineage Rom:

a - Go to `Wipe` and swipe to `Factory Reset`

b - Go to `Install` and select the lineage zip file on the device. Swipe to install

c - Go to `Install` and select the TWRP zip file on the device. Swipe to install

d - Go to `Reboot` and take note of the current slot. Then select `Recovery` to reboot into the installed TWRP

Note: after performing the previous step, you may get a "No OS is installed" warning from TWRP. That's normal. It is ok to swipe to proceed.

e - After rebooting, go to `Reboot` and note the current slot. It should be in the opposite slot from what you were in during the previous step. That switch automatically happens after you flash a custom rom. If you're still in the same slot then something went wrong and you should start over. If you are in the opposite slot, then go back to TWRP home and continue with the next step.

f - Go to `Install` and select `Install Image` and select the stock vendor img, then select `Vendor` partition.

g - Go to `Mount` and select to mount `Vendor`. Go back to TWRP home

h - Go to `Advanced` - > `File Manager`. Navigate to /vendor/overlay/, then click the checkmark in the bottom right. Select `Delete`. Then go back to TWRP home

i - Go to `Install` and select the Opengapps zip file. Swipe to install (This step is optional. Only needed if you want google apps.)

j - After installation completes, select `Reboot System`

k - You should now see the LineageOS boot animation. The initial boot may take several minutes

Flashing Magisk: (Optional)

Note: If you want root you can flash magisk at any time in the future, but not during the initial install. You must boot into lineage rom at least once.

a - Reboot into twrp and go to 'Reboot' and make sure you're in the same slot you were in at step 3.e

b - Go to `Install` and select the Magisk zip file. Swipe to install

c - After installation completes, select `Reboot System`