The Complete Pixel 3 How-To Guide (newbie friendly!)

Search This thread

rczrider

Senior Member
May 20, 2015
685
513
Markarth
There's a ton of information out there, but finding it can sometimes be a challenge, especially for a newbie. And then there's posts to read through, in case a process has changed and it's only talked about in a single place, buried any number of pages back. So this is my attempt to put all Pixel 3 how-to's into a single thread. Everything below is what worked for me, from start to finish, with a fresh phone directly from Google that was bootloader-locked, unrooted, and running stock Android. Comments are welcome and encouraged: if something doesn't work for you, or you have a better/quicker/more reliable way of doing something, or maybe I made a mistake...let me know!

A few things:
  1. Everything in this guide was tested on a "regular" Pixel 3 (blueline). It should all work exactly the same on a Pixel 3 XL (crosshatch), as long as you download the appropriate files (specifically the factory/OTA images and TWRP). I'm posting this in both blueline and crosshatch forums.
  2. This first post will have links to files and the tools you need, as well as general things (like how to enable debugging and boot into recovery). The second post has how-to's for the big stuff (flashing images, TWRP, unlocking, etc).
  3. I'm not responsible for anything you do. Follow these guides at your own risk. Doing so may also void your warranty.

Files and URLs

Official Android files
Factory (wipes device and requires unlocked bootloader): https://developers.google.com/android/images
Full OTA (leaves data intact, can be done via ADB sideload): https://developers.google.com/android/ota
Preview/beta OTA: https://developer.android.com/preview/download-ota.html

TWRP
XDA thread: https://forum.xda-developers.com/pixel-3/development/twrp-3-2-3-0-pixel-3-t3861622
Download: https://dl.twrp.me/blueline/

Magisk
XDA thread: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
GitHub: https://github.com/topjohnwu/Magisk/releases

ADB and Fastboot
Google USB drivers: https://developer.android.com/studio/run/win-usb
SDK platform tools: https://developer.android.com/studio/releases/platform-tools
  1. Download the ZIP and open (no need to extract the whole thing)
  2. Copy the files below to their own directory (you will use this directory for all ADB/Fastboot commands):
    • adb.exe
    • AdbWinApi.dll
    • AdbWinUsbApi.dll
    • fastboot.exe

General

Enable USB debugging
  1. Download Google USB drivers (see above)
  2. Download SDK platform tools and copy required files to their own directory (see above)
  3. Enable USB debugging (Settings > About > tap Build 7 times > back > Developer options)
  4. Plug phone into computer and when "Allow USB debugging" box comes up, check the box and allow (may need to have adb daemon running on the computer already, see below)

Fastboot mode (using hardware keys) aka bootloader
  1. Power off
  2. Hold VOL- and press/hold PWR until bootloader (fastboot) comes up

Recovery mode (using hardware keys)
  1. Get into Fastboot mode (see above)
  2. Use VOL buttons to find Recovery in the list, use PWR to select (should boot to broken android image)
  3. Hold PWR and press VOL+ once to get into recovery

Useful ADB and Fastboot commands
  1. Enable USB debugging (see above)
  2. ADB (used while phone is "on" and booted up):
    • Use "adb devices" to ensure the computer is authorized
    • Use "adb reboot bootloader" to get into Fastboot
  3. Fastboot mode
    • Use "fastboot devices" to verify computer can see your phone
 
Last edited:

rczrider

Senior Member
May 20, 2015
685
513
Markarth
Update #1: Items below marked through were removed since they don't really apply to Android 10.
Update #2: Edited to reflect changes in root with Android 11.

A quick note: everything below is assuming you're using Windows 10. When it says "Type...", this assumes you've opened a command window in the location of adb/fastboot and that all files referenced are in the same directory and (in some cases) renamed as I reference them (short names without spaces simplifies things). If you're using Powershell, you will probably need to change "adb" and "fastboot" to read ".\adb" and ".\fastboot" so Powershell will use the local files.

Unlocking the bootloader
  1. THIS WILL WIPE YOUR PHONE, SO MAKE SURE EVERYTHING IS BACKED UP!
  2. In Developer Options, enable OEM unlocking and confirm (it may ask you to input fingerprint or PIN/pattern/password)
  3. Boot into Fastboot mode (see above)
  4. Type to unlock:
    Code:
    fastboot flashing unlock
  5. Use VOL+ key to get the options on the screen to read "Unlock the bootloader" and use PWR button to select
  6. Type to reboot:
    Code:
    fastboot reboot

Locking the bootloader
  1. THIS WILL WIPE YOUR PHONE, SO MAKE SURE EVERYTHING IS BACKED UP!
  2. Boot into Fastboot mode (see above)
  3. IMPORTANT: restore stock recovery if you replaced it with TWRP (this should prevent the "Can't find valid operating system" issue)
  4. Type to lock:
    Code:
    fastboot flashing lock
  5. Use VOL buttons to find "Lock the bootloader" and use PWR to select
  6. Type to reboot:
    Code:
    fastboot reboot

Factory reset via fastboot (can also do this without wiping data)
  1. THIS COULD WIPE YOUR PHONE, SO MAKE SURE EVERYTHING IS BACKED UP!
  2. Download factory image ZIP and unzip all files into their own folder
  3. Unlock bootloader (see above)
  4. Reboot into Fastboot mode
  5. You have 2 options:
    1. Register the location of fastboot.exe with the PATH system variable and run "flash-all.bat"
      • Wipe data: just run "flash-all.bat" and call it a day
      • Do not wipe data: open "flash-all.bat" in a text editor (careful not to double-click and run it!), remove the "-w" from the last line to disable the wiping of data, then save, close, and run
    2. Move the 3 files (bootloader IMG, radio IMG, image ZIP) into the ADB folder, rename for simplicity if you want, launch cmd or Powershell, and run the commands below (which come from "flash-all.bat")
      • Wipe data: type out commands below, but at last line, add "-w" flag: fastboot -w update image.zip
      • Do not wipe data: type out commands below as written (no "-w" flag)
      • The commands:
        Code:
        fastboot flash bootloader bootloader-blueline-XXXX.img
        fastboot reboot bootloader
        [wait for reboot]
        fastboot flash radio radio-blueline-XXXX.img
        fastboot reboot bootloader
        [wait for reboot]
        fastboot update image-blueline-XXXX.zip
      • Note: The last command (update image) will launch the red "fastbootd" screen, so don't worry and be patient while the command line tells you what's happening. The phone will reboot on its own into the Android system (not fastboot) afterward.

Root Android 10+ using Magisk (Canary channel)
This must be done after every update, and you cannot use the patched file from a different phone!
  1. Unlock bootloader (see above)
  2. Download factory image (not OTA, see link above)
  3. Download and install Magisk Manager Canary (see link above)
  4. In Magisk Manager settings, set Update Channel to "Canary"
  5. Extract boot.img from image-blueline-XXXX.zip found in the factory image you downloaded
  6. Place boot.img on your phone's internal storage
  7. Open Magisk Manager and do:
    1. tap "Install" button (next to "Magisk" in first block on the main screen)
    2. "Select and Patch a File" option
    3. Find boot.img file you just placed on your phone
    4. tap "Let's Go"
  8. When finished, move the newly-created magisk_patched.img file over to your computer's ADB directory
  9. Reboot into bootloader
  10. Type:
    Code:
    fastboot flash boot magisk_patched.img
    fastboot reboot
  11. Open up Magisk Manager and make sure everything's good!
  12. Note : if you get stuck in fastboot mode or in a boot loop, flash the stock boot.img to both slots and try again
    Code:
    fastboot flash boot boot.img --slot all
  13. Optional:
    1. for adblocking, tap "Systemless hosts" in Magisk Manager, then install AdAway using F-Droid
    2. install a performance kernel like Kirisakura for Bluecross (R)

Updating Android 10+ while rooted
You can't take an OTA while rooted, so updating Android 10+ (as in monthly updates) can be one of two ways.
  1. Method #1 (faster, but more chance for issues)
    1. Download OTA ZIP and move it to ADB folder (don't unzip it)
    2. This does not require an unlocked bootloader, but does require USB debugging (see above)
    3. Get boot.img from the factory image (see first post on where to download this) and place your ADB directory
    4. Reboot into bootloader / fastboot and type to restore stock boot to both slots:
      Code:
      fastboot flash boot --slot all boot.img
      fastboot reboot bootloader
      [wait for reboot]
    5. Use VOL buttons to select "Apply update from ADB"
    6. Type (where filename is the name of the file you want to sideload):
      Code:
      adb sideload filename.zip
    7. Wait for it to finish, will take you back to Recovery when it's done
    8. Reboot using menu
  2. Method #2 (takes longer, but best bet for minimal issues)
    1. Follow "Factory reset via fastboot" instructions (see above, make sure you don't wipe your data!)
    2. Take the OTA in the official way (through Android)
    3. Follow "Root Android 10+ using Magisk Canary" instructions (see above)

Boot into TWRP (3.3.0-0 or higher)
  1. Download TWRP IMG and place in ADB folder (rename the file to twrp.img)
  2. If not already done, unlock the bootloader (see above)
  3. Reboot into bootloader
  4. Type to boot TWRP (it will restart and should boot into TWRP):
    Code:
    fastboot boot twrp.img
  5. OPTIONAL: Replace recovery by installing TWRP
    1. Your phone should automatically mount, so move twrp.img from PC to Download folder on phone's internal storage
    2. Advanced > Install Recovery Ramdisk > choose TWRP IMG > Swipe to install
    3. Back > Fix Recovery Bootloop > Reboot System > Do Not Install when asked if TWRP should install app

Root using Magisk (18.1 or higher)
  1. Download Magisk ZIP and move to device
  2. Boot into TWRP (see above)
  3. Enter your PIN/pattern/password to decrypt (unnecessary if you are not using security on your phone)
  4. Swipe to Allow Modifications (to system)
  5. Install > find and select the Magisk ZIP > Slide to install
  6. Wipe cache > Reboot system > Do Not Install when asked if TWRP should install app
  7. Open Magisk Manager to verify latest and to install modules

"Can't find valid operating system" booting issue
  1. Unlock your bootloader again (see above)
  2. Follow steps for "Factory reset via fastboot" (see above) and keep the wipe flag
  3. After it reboots, power off (press PWR and select "Power off" from menu)
  4. Follow steps for "Locking the bootloader" (see above)
  5. After it reboots into Fastboot mode, have it start using the PWR button

Android Recovery / "Cannot load Android system" booting issue
This can happen for a number of reasons, but the fix is the same: "Factory reset via fastboot" (see above). You probably do not need to wipe user data, so you can omit the "-w" flag.

If you still get the error message, select the "Try again" option. If it still doesn't work, try "Factory reset via fastboot" again, as well as "Try again". If it doesn't work this time, you probably have no choice but to do a factory reset (in which you will definitely lose your data).

If it happens after flashing Magisk in TWRP, though, you've got a slightly different issue and the problem will persist no matter how many times you flash the factory images and re-install Magisk. This is probably due to something leftover in the previous Magisk installation that conflicts with the new installation. There are two ways to handle this.

First and easiest: uninstall Magisk Manager app before rebooting into the bootloader and running fastboot commands. Then proceed as usual (sideload OTA or flash factory images via fastboot, boot TWRP, and flash Magisk). All guides for this are above. This method preserves any modules you have installed.

Second and more complete (if the above method still gives you trouble):
  1. download to your phone the Magisk ZIP, Magisk Uninstaller ZIP, and Magisk APK from this XDA thread
  2. uninstall the Magisk Manager app
  3. reboot to bootloader
  4. using fastboot, boot into TWRP using IMG (you don't need to replace boot with TWRP)
  5. flash Magisk Uninstaller ZIP
  6. wipe Dalvik
  7. flash Magisk ZIP
  8. wipe Dalvik
  9. reboot system (do not install TWRP)
  10. install Magisk Manager APK and re-install any modules
 
Last edited:

rczrider

Senior Member
May 20, 2015
685
513
Markarth
Number 3 in "Applying OTA via ADB sideload" should be flash stock boot.img I think.
I wrote it like that because the file isn't actually called "boot.img", but rather "bootloader-blueline-blahblahblah.img" where "blahblahblah" is the release. Since it changes, I figured just calling it the "bootloader IMG" would make more sense.
 
Last edited:

wangdaning

Senior Member
Sep 17, 2012
1,377
571
Wuxi
I wrote it like that because the file isn't actually called "boot.img", but rather "bootloader-blueline-blahblahblah.img" where "blahblahblah" is the release. Since it changes, I figured just calling it the "bootloader IMG" would make more sense.

Was my misunderstanding. I thought you were implying people should go back to stock recovery to flash ota. You are talking about flashing ota in twrp. You might clear that up a little bit in that section.
 

gatorcq

Member
Feb 23, 2008
16
0
Unfortunately, if you are writing a process, then writing everything out is a requirement. Especially with item numbers or using an outline format. Not everyone understands shortcuts taken or abbreviated words, unless they are spelled out in the beginning. IMO, wrote and read too many processes. Including software requirement documentation.
 

laupuy

Senior Member
Jul 26, 2015
1,854
2,058
dans tes 22
Hi,
thanks for the thread :good:

Number 3 in "Applying OTA via ADB sideload" should be flash stock boot.img I think.
Yes, I think so too.

I wrote it like that because the file isn't actually called "boot.img", but rather "bootloader-blueline-blahblahblah.img" where "blahblahblah" is the release. Since it changes, I figured just calling it the "bootloader IMG" would make more sense.

The boot.img is into "image.zip"

Then I suggest to flash into a and b (or both)
Code:
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
or
fastboot flash boot --slot all boot.img

Edit
be careful here: Factory reset via ADB sideload (can also do this without wiping data)
bootloader is bootloader, boot is boot, bootloader.img isn't boot.img
so, maybe better to write:
fastboot flash bootloader nameofbootloader.img or if simply renamed fastboot flash bootloader bootloader.img
;)
 

Attachments

  • image-zip.JPG
    image-zip.JPG
    23.9 KB · Views: 566
  • bootimg.jpg
    bootimg.jpg
    85.9 KB · Views: 566
Last edited:

fyrmd

Senior Member
Sep 25, 2011
80
2
trouble flashing files

When I try to flash twrp.img or boot.img this is what I get back " FAILED (Write to device failed in Send Buffer() (Too many links)) fastboot: error: Command failed.

Any thoughts?
 

wangdaning

Senior Member
Sep 17, 2012
1,377
571
Wuxi
When I try to flash twrp.img or boot.img this is what I get back " FAILED (Write to device failed in Send Buffer() (Too many links)) fastboot: error: Command failed.

Any thoughts?

Please read the instructions carefully. You cannot flash twrp directly. "fastboot boot twrp.img" then when twrp boots you can use it or make it permanent by flashing the install zip or the internal twrp option. I go with the install zip as it seems more stable to me (placebo I suppose).
 

fyrmd

Senior Member
Sep 25, 2011
80
2
Please read the instructions carefully. You cannot flash twrp directly. "fastboot boot twrp.img" then when twrp boots you can use it or make it permanent by flashing the install zip or the internal twrp option. I go with the install zip as it seems more stable to me (placebo I suppose).

Thanks, but still no luck.
 

fyrmd

Senior Member
Sep 25, 2011
80
2
When I try to flash twrp.img or boot.img this is what I get back " FAILED (Write to device failed in Send Buffer() (Too many links)) fastboot: error: Command failed.

Any thoughts?

Turns out it was the cable, it is an expensive one from Amazon so not sure what I should be purchasing for next time.
 

xiaowei666

Member
Aug 19, 2017
38
1
Now,my pixel 3 can not work,the bootload is locked.when I select recovery by fastboot,The phone noticed me can not find vaild operating system,the device will not start.
 

sudoxd

Senior Member
Jan 16, 2017
212
51
Adelaide
sudoxd.xyz
[*]Copy the files below to their own directory (you will use this directory for all ADB/Fastboot commands):
  • adb.exe
  • AdbWinApi.dll
  • AdbWinUsbApi.dll
  • fastboot.exe
why not copy all files?

---------- Post added at 11:58 AM ---------- Previous post was at 11:55 AM ----------

Thanks, but still no luck.

boot to the twrp.img and flash the twrp.zip, unless you are on android 10 you should have no problem unless you are doing it wrong. not exactly hard to do.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    There's a ton of information out there, but finding it can sometimes be a challenge, especially for a newbie. And then there's posts to read through, in case a process has changed and it's only talked about in a single place, buried any number of pages back. So this is my attempt to put all Pixel 3 how-to's into a single thread. Everything below is what worked for me, from start to finish, with a fresh phone directly from Google that was bootloader-locked, unrooted, and running stock Android. Comments are welcome and encouraged: if something doesn't work for you, or you have a better/quicker/more reliable way of doing something, or maybe I made a mistake...let me know!

    A few things:
    1. Everything in this guide was tested on a "regular" Pixel 3 (blueline). It should all work exactly the same on a Pixel 3 XL (crosshatch), as long as you download the appropriate files (specifically the factory/OTA images and TWRP). I'm posting this in both blueline and crosshatch forums.
    2. This first post will have links to files and the tools you need, as well as general things (like how to enable debugging and boot into recovery). The second post has how-to's for the big stuff (flashing images, TWRP, unlocking, etc).
    3. I'm not responsible for anything you do. Follow these guides at your own risk. Doing so may also void your warranty.

    Files and URLs

    Official Android files
    Factory (wipes device and requires unlocked bootloader): https://developers.google.com/android/images
    Full OTA (leaves data intact, can be done via ADB sideload): https://developers.google.com/android/ota
    Preview/beta OTA: https://developer.android.com/preview/download-ota.html

    TWRP
    XDA thread: https://forum.xda-developers.com/pixel-3/development/twrp-3-2-3-0-pixel-3-t3861622
    Download: https://dl.twrp.me/blueline/

    Magisk
    XDA thread: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
    GitHub: https://github.com/topjohnwu/Magisk/releases

    ADB and Fastboot
    Google USB drivers: https://developer.android.com/studio/run/win-usb
    SDK platform tools: https://developer.android.com/studio/releases/platform-tools
    1. Download the ZIP and open (no need to extract the whole thing)
    2. Copy the files below to their own directory (you will use this directory for all ADB/Fastboot commands):
      • adb.exe
      • AdbWinApi.dll
      • AdbWinUsbApi.dll
      • fastboot.exe

    General

    Enable USB debugging
    1. Download Google USB drivers (see above)
    2. Download SDK platform tools and copy required files to their own directory (see above)
    3. Enable USB debugging (Settings > About > tap Build 7 times > back > Developer options)
    4. Plug phone into computer and when "Allow USB debugging" box comes up, check the box and allow (may need to have adb daemon running on the computer already, see below)

    Fastboot mode (using hardware keys) aka bootloader
    1. Power off
    2. Hold VOL- and press/hold PWR until bootloader (fastboot) comes up

    Recovery mode (using hardware keys)
    1. Get into Fastboot mode (see above)
    2. Use VOL buttons to find Recovery in the list, use PWR to select (should boot to broken android image)
    3. Hold PWR and press VOL+ once to get into recovery

    Useful ADB and Fastboot commands
    1. Enable USB debugging (see above)
    2. ADB (used while phone is "on" and booted up):
      • Use "adb devices" to ensure the computer is authorized
      • Use "adb reboot bootloader" to get into Fastboot
    3. Fastboot mode
      • Use "fastboot devices" to verify computer can see your phone
    8
    Update #1: Items below marked through were removed since they don't really apply to Android 10.
    Update #2: Edited to reflect changes in root with Android 11.

    A quick note: everything below is assuming you're using Windows 10. When it says "Type...", this assumes you've opened a command window in the location of adb/fastboot and that all files referenced are in the same directory and (in some cases) renamed as I reference them (short names without spaces simplifies things). If you're using Powershell, you will probably need to change "adb" and "fastboot" to read ".\adb" and ".\fastboot" so Powershell will use the local files.

    Unlocking the bootloader
    1. THIS WILL WIPE YOUR PHONE, SO MAKE SURE EVERYTHING IS BACKED UP!
    2. In Developer Options, enable OEM unlocking and confirm (it may ask you to input fingerprint or PIN/pattern/password)
    3. Boot into Fastboot mode (see above)
    4. Type to unlock:
      Code:
      fastboot flashing unlock
    5. Use VOL+ key to get the options on the screen to read "Unlock the bootloader" and use PWR button to select
    6. Type to reboot:
      Code:
      fastboot reboot

    Locking the bootloader
    1. THIS WILL WIPE YOUR PHONE, SO MAKE SURE EVERYTHING IS BACKED UP!
    2. Boot into Fastboot mode (see above)
    3. IMPORTANT: restore stock recovery if you replaced it with TWRP (this should prevent the "Can't find valid operating system" issue)
    4. Type to lock:
      Code:
      fastboot flashing lock
    5. Use VOL buttons to find "Lock the bootloader" and use PWR to select
    6. Type to reboot:
      Code:
      fastboot reboot

    Factory reset via fastboot (can also do this without wiping data)
    1. THIS COULD WIPE YOUR PHONE, SO MAKE SURE EVERYTHING IS BACKED UP!
    2. Download factory image ZIP and unzip all files into their own folder
    3. Unlock bootloader (see above)
    4. Reboot into Fastboot mode
    5. You have 2 options:
      1. Register the location of fastboot.exe with the PATH system variable and run "flash-all.bat"
        • Wipe data: just run "flash-all.bat" and call it a day
        • Do not wipe data: open "flash-all.bat" in a text editor (careful not to double-click and run it!), remove the "-w" from the last line to disable the wiping of data, then save, close, and run
      2. Move the 3 files (bootloader IMG, radio IMG, image ZIP) into the ADB folder, rename for simplicity if you want, launch cmd or Powershell, and run the commands below (which come from "flash-all.bat")
        • Wipe data: type out commands below, but at last line, add "-w" flag: fastboot -w update image.zip
        • Do not wipe data: type out commands below as written (no "-w" flag)
        • The commands:
          Code:
          fastboot flash bootloader bootloader-blueline-XXXX.img
          fastboot reboot bootloader
          [wait for reboot]
          fastboot flash radio radio-blueline-XXXX.img
          fastboot reboot bootloader
          [wait for reboot]
          fastboot update image-blueline-XXXX.zip
        • Note: The last command (update image) will launch the red "fastbootd" screen, so don't worry and be patient while the command line tells you what's happening. The phone will reboot on its own into the Android system (not fastboot) afterward.

    Root Android 10+ using Magisk (Canary channel)
    This must be done after every update, and you cannot use the patched file from a different phone!
    1. Unlock bootloader (see above)
    2. Download factory image (not OTA, see link above)
    3. Download and install Magisk Manager Canary (see link above)
    4. In Magisk Manager settings, set Update Channel to "Canary"
    5. Extract boot.img from image-blueline-XXXX.zip found in the factory image you downloaded
    6. Place boot.img on your phone's internal storage
    7. Open Magisk Manager and do:
      1. tap "Install" button (next to "Magisk" in first block on the main screen)
      2. "Select and Patch a File" option
      3. Find boot.img file you just placed on your phone
      4. tap "Let's Go"
    8. When finished, move the newly-created magisk_patched.img file over to your computer's ADB directory
    9. Reboot into bootloader
    10. Type:
      Code:
      fastboot flash boot magisk_patched.img
      fastboot reboot
    11. Open up Magisk Manager and make sure everything's good!
    12. Note : if you get stuck in fastboot mode or in a boot loop, flash the stock boot.img to both slots and try again
      Code:
      fastboot flash boot boot.img --slot all
    13. Optional:
      1. for adblocking, tap "Systemless hosts" in Magisk Manager, then install AdAway using F-Droid
      2. install a performance kernel like Kirisakura for Bluecross (R)

    Updating Android 10+ while rooted
    You can't take an OTA while rooted, so updating Android 10+ (as in monthly updates) can be one of two ways.
    1. Method #1 (faster, but more chance for issues)
      1. Download OTA ZIP and move it to ADB folder (don't unzip it)
      2. This does not require an unlocked bootloader, but does require USB debugging (see above)
      3. Get boot.img from the factory image (see first post on where to download this) and place your ADB directory
      4. Reboot into bootloader / fastboot and type to restore stock boot to both slots:
        Code:
        fastboot flash boot --slot all boot.img
        fastboot reboot bootloader
        [wait for reboot]
      5. Use VOL buttons to select "Apply update from ADB"
      6. Type (where filename is the name of the file you want to sideload):
        Code:
        adb sideload filename.zip
      7. Wait for it to finish, will take you back to Recovery when it's done
      8. Reboot using menu
    2. Method #2 (takes longer, but best bet for minimal issues)
      1. Follow "Factory reset via fastboot" instructions (see above, make sure you don't wipe your data!)
      2. Take the OTA in the official way (through Android)
      3. Follow "Root Android 10+ using Magisk Canary" instructions (see above)

    Boot into TWRP (3.3.0-0 or higher)
    1. Download TWRP IMG and place in ADB folder (rename the file to twrp.img)
    2. If not already done, unlock the bootloader (see above)
    3. Reboot into bootloader
    4. Type to boot TWRP (it will restart and should boot into TWRP):
      Code:
      fastboot boot twrp.img
    5. OPTIONAL: Replace recovery by installing TWRP
      1. Your phone should automatically mount, so move twrp.img from PC to Download folder on phone's internal storage
      2. Advanced > Install Recovery Ramdisk > choose TWRP IMG > Swipe to install
      3. Back > Fix Recovery Bootloop > Reboot System > Do Not Install when asked if TWRP should install app

    Root using Magisk (18.1 or higher)
    1. Download Magisk ZIP and move to device
    2. Boot into TWRP (see above)
    3. Enter your PIN/pattern/password to decrypt (unnecessary if you are not using security on your phone)
    4. Swipe to Allow Modifications (to system)
    5. Install > find and select the Magisk ZIP > Slide to install
    6. Wipe cache > Reboot system > Do Not Install when asked if TWRP should install app
    7. Open Magisk Manager to verify latest and to install modules

    "Can't find valid operating system" booting issue
    1. Unlock your bootloader again (see above)
    2. Follow steps for "Factory reset via fastboot" (see above) and keep the wipe flag
    3. After it reboots, power off (press PWR and select "Power off" from menu)
    4. Follow steps for "Locking the bootloader" (see above)
    5. After it reboots into Fastboot mode, have it start using the PWR button

    Android Recovery / "Cannot load Android system" booting issue
    This can happen for a number of reasons, but the fix is the same: "Factory reset via fastboot" (see above). You probably do not need to wipe user data, so you can omit the "-w" flag.

    If you still get the error message, select the "Try again" option. If it still doesn't work, try "Factory reset via fastboot" again, as well as "Try again". If it doesn't work this time, you probably have no choice but to do a factory reset (in which you will definitely lose your data).

    If it happens after flashing Magisk in TWRP, though, you've got a slightly different issue and the problem will persist no matter how many times you flash the factory images and re-install Magisk. This is probably due to something leftover in the previous Magisk installation that conflicts with the new installation. There are two ways to handle this.

    First and easiest: uninstall Magisk Manager app before rebooting into the bootloader and running fastboot commands. Then proceed as usual (sideload OTA or flash factory images via fastboot, boot TWRP, and flash Magisk). All guides for this are above. This method preserves any modules you have installed.

    Second and more complete (if the above method still gives you trouble):
    1. download to your phone the Magisk ZIP, Magisk Uninstaller ZIP, and Magisk APK from this XDA thread
    2. uninstall the Magisk Manager app
    3. reboot to bootloader
    4. using fastboot, boot into TWRP using IMG (you don't need to replace boot with TWRP)
    5. flash Magisk Uninstaller ZIP
    6. wipe Dalvik
    7. flash Magisk ZIP
    8. wipe Dalvik
    9. reboot system (do not install TWRP)
    10. install Magisk Manager APK and re-install any modules
    1
    Number 3 in "Applying OTA via ADB sideload" should be flash stock boot.img I think.