• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[Guide] Root Pixel 4 XL Android 11 (R)

Search This thread

Tyrany

Senior Member
Sep 19, 2011
812
400
Faro
Android Wear
Google Pixel 4 XL
Hello i'm facing a strange problem, im on beta 1, using latest platfomr tools, and have bootloader unlocked+debugging, but when i try to flash the boot
Code:
sending 'boot' (65536 KB)...
OKAY [  1.509s]
writing 'boot'...
FAILED (remote: Failed to write to partition Not Found)
finished. total time: 1.663s

any advice please?
 

crixley

Senior Member
May 25, 2012
4,675
2,033
Hello i'm facing a strange problem, im on beta 1, using latest platfomr tools, and have bootloader unlocked+debugging, but when i try to flash the boot
Code:
sending 'boot' (65536 KB)...
OKAY [  1.509s]
writing 'boot'...
FAILED (remote: Failed to write to partition Not Found)
finished. total time: 1.663s

any advice please?

You aren't in fastbootd vs regular fastboot are you?
 

biTToe

Senior Member
Jul 11, 2012
75
18
Ok,
So... if I use Android Flash Tool to install 11.0.0 (RQ2A.210505.002, May 2021)
then all I have left to do is:

6. Extract/Flash boot.img

Do I need to fastboot flash boot --slot all boot.img or is that taken care of with AFT?
7. Root/Reroot with Magisk and Pass SafetyNet.
...Enjoy

Am i missing anything?
Or should I not be lazy and do it the old fashioned way?
 
Last edited:

Homeboy76

Senior Member
Aug 24, 2012
2,582
1,276
Ok,
So... if I use Android Flash Tool to install 11.0.0 (RQ2A.210505.002, May 2021)
then all I have left to do is:

6. Extract/Flash boot.img

Do I need to fastboot flash boot --slot all boot.img or is that taken care of with AFT?
7. Root/Reroot with Magisk and Pass SafetyNet.
...Enjoy

Am i missing anything?
Or should I not be lazy and do it the old fashioned way?
The Instructions (Flashing your device) are located in the Android Flash Tool thread (see my post above for the link).
I prefer the Old fashion way (#4 'Keep data'). :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    [Guide] Root Pixel 4 XL Android 11 (R) Unlock/Lock Bootloader + Systemless ROOT
    Android Security Bulletin—July 2021
    Pixel Update Bulletin—July 2021

    Introduction
    This Guide is for Pixel 4 XL owners that want to Root their phone, and enjoy the benefits of rooting it without installing a Custom ROM. However, for those that just can't live without a Custom ROM, take a look at 'Custom ROMs for Pixel 4 XL'.

    New
    1. vvb2060 Magisk Alpha
      Note(s):
    2. Android 12 Developer Preview - Beta 3

    Update(s)
    1. Factory/OTA Images - 07/07
    2. Magisk Stable - Magisk-23.0 05/12
    3. Magisk Beta - Magisk-23.0 05/12
    4. Magisk Canary - Magisk-23xxx
    5. TWRP - TWRP Coral [Official] - Android 11 Testing
    6. SafetyNet - SafetyNetFix v1.2.0
    7. SDK Platform-tools - r31.0.2 April
    8. Custom Kernels
      • ElementalX vP5-1.00 11/17
      • CleanSlate vR2.7.12 07/09 S3.7.9 07/15
      • FrankenKernel vP5 11/28
      • Kirisakura Kernel v7.9.0 07/08
    9. OS
    10. Custom ROMs
      • [Official] LineageOS v18.1
      • PixelDust
      • [Official] ScorpionROM v4.x
      • BlissROMs 12.8
      • [Official] ProtonAOSP

    Disclaimer
    1. I assume no responsibility for the malfunctioning/bricking of your phone.
    2. The order of listed items i.e., Custom Kernels, Custom ROMS, etc. Does not indicate my preference for them. It is your responsibility to do the research before selecting an item.

    Prerequisites
    1. A Pixel 4 XL phone with an unlocked bootloader.
    2. The latest Android 11 (R) Factory or OTA Image: "coral" for Pixel 4 XL

      Factory Image

      OTA Image
    3. Computer - With the latest SDK Platform-Tools: r31.0.2 installed.
      • Important: Update Platform Tools, regularly, for optimal performance.

    Other Guides
    [Guide] Pixel 5 Android 11 (R)

    Credits/Thanks/Recognitions

    1. @topjohnwu - Magisk Beta/Canary/Stable
    2. Those I may have, inadvertently, forgotten.

    Index
    (NOTE: Numbers 1-11 are not steps, they are individual sets of instructions).
    1. Open a Command Prompt/Boot Fastboot Mode/Boot Recovery

      • Open Command Prompt on Computer
        1. Option 1 - Open File Explorer, click the platform-tools folder, press shift, right click, and select open command prompt here.
        2. Option 2 - Open File Explorer, click the platform-tools folder, highlight the directory information in the address bar or click the folder (left side of address bar) to highlight it type cmd and press enter.
        3. Option 3 - Open File Explorer, click the platform-tools folder, press shift, right click, and select open powershell here.
          Notes:
      • Boot fastboot mode:
        • Power off phone, press and hold the power and volume down buttons until you see Start.
      • Boot Recovery
        • Power off phone, press and hold the power and volume down buttons until you see Start. Use volume up/down button until you see Recovery mode. Press power button.
    2. Test fastboot

      • Enable Developer Options - Tap Settings > About phone > Build number 7 times or until you should see 'you are a Developer'.
      • Enable USB Debugging - Tap Settings > System > Advanced > Developer options >
        Enable USB Debugging.
      • Open a Command Prompt on your computer in the Platform-tools folder.
      • Boot fastboot mode on your phone (#1)
      • Connect the phone to the Computer.
      • At the prompt type: fastboot devices to verify communication with phone. It should return your phone's serial number.
    3. Unlock Bootloader/Return Phone to Stock/Lock Bootloader

      • Unlock Bootloader

        1. This will erase all user data from the device!
        2. Backup your data
        3. Activate Developer Options: Tap Settings > About Phone > Tap Build Number 7 times or until you see you are a Developer. Tap back > System > Advanced > Developer Options. Enable OEM Unlock and, USB Debugging.
        4. Boot fastboot mode
        5. Connect the phone to the Computer with USB cord.
        6. Open a Command Prompt on your computer and type fastboot flashing unlock and press enter.
        7. You should see a request for confirmation on your phone, use the volume keys to scroll and the power key to select.
        8. Allow the process to complete and then type fastboot reboot at the Command Prompt and press enter.
        9. When your phone reboots disconnect your usb cable.
          Notes: After unlocking your bootloader, you'll see a warning: You will see this warning until, you relock the bootloader.
          Do not relock your bootloader until you have returned the device to Stock.
          .
      • Return Phone to Stock

        1. Backup your data/Internal storage
        2. Settings > System > Advanced > Reset Options > Erase all data (factory reset)
        3. Log in
        4. Set up phone
      • Lock Bootloader

        1. Return the phone to Stock before locking the bootloader, failure to do so could brick your phone
        2. This will erase all user data from the device!
        3. Boot fastboot mode
        4. Open a Command Prompt and type this at the Prompt: fastboot flashing lock
        5. You should see a request for confirmation on your phone, use the volume keys to scroll and the power key to select.
        6. Allow the process to complete, then type this at the Command Prompt: fastboot reboot
        7. Enable Developer Options: Settings > About phone > Tap Build number 7 times or until you see 'you are a developer'.
        8. Tap Back > Developer options and toggle OEM Unlock off.
    4. Install/Update Factory Image keep or wipe data

      • Important Note(s):
        1. When doing a major upgrade i.e., Android 10 (Q) to Android 11 (R): I recommend doing a clean install. What is a clean install?
          • Doing a Factory reset prior to installing, major, update.
          • Using flash-all.bat file without removing the -w (#4. Wipe Data).
        2. Always verify you have the latest version of SDK Platform-Tools installed on your computer before installing the Factory Image: Pixel 4XL - coral.
        3. If your phone was rooted, and you want to 'Keep Data'. Do this first open Magisk ==> unhide Magisk App (if you hid it) ==> Disable/Remove all modules ==> then Uninstall Magisk - Restore images prior flashing the Factory image. Why? The changes in the New factory image may cause Magisk modules to fail. This will cause boot loops. Additionally, before Enabling/Installing the modules you Disabled/Removed check with the Dev of the module to ensure it was updated to work with the latest factory image.
        4. If you get an error while flashing, try one of these options:
          • Change the USB port to a non charging USB port.
          • Change the USB cord.
          • Change Computers.
        5. Backup your data
        6. Download the latest Factory Image: Pixel 4XL - coral to your Computer.
        7. Extract the factory Image to a folder.
      • Flash Factory Image Keep Data

        • Open the folder you extracted the Factory Image to and Edit the flash-all.bat file with a file editor i.e., Notepad. Remove the -w from this command: fastboot -w update image-coral-aa9a.999999.999.zip
          Note: If you do not remove the -w your data and internal storage will be wiped.[/B]
        • After, you have edited the flash-all.bat file. Copy/Move these files to the Platform-tools folder:
          1. bootloader-coral-....img
          2. flash-all.bat
          3. image-coral-....zip
          4. radio-coral-....img
        • Open a Command Prompt on your computer in the Platform-tools and type: flash-all at the Command Prompt and press enter.
        • System will reboot when flashing is complete.
        • Do #7 to root/reroot.
      • Flash Factory Image Wipe Data

        • This will wipe your phones Internal Storage.
        • Open the folder you extracted the Factory Image to and Copy/Move these files to the Platform-tools folder:
          1. bootloader-coral-....img
          2. flash-all.bat
          3. image-coral-....zip
          4. radio-coral-....img
        • Open a Command Prompt on your computer in the Platform-tools folder and type: flash-all at the Command Prompt and press enter.
        • The phone will reboot when flashing is complete.
        • Do #7 to root/reroot.
    5. ADB Sideload

    6. Extract/Flash boot.img

      • Extract boot.img

        1. Download the latest Factory image to your phone.
        2. Extract the Factory Image file (coral-RQ1A.999999.999-factory-99a9a99a.zip) to a folder.
        3. Open the folder and, extract the Image file (image-coral-aa9a.999999.999.zip) into the folder.
      • Flash boot.img

        1. Flashing the boot.img removes root.
        2. Open the folder you extracted the 'image...zip' file to and copy the boot.img file to your computer's platform-tools folder or to the folder that has fastboot.exe in it.
        3. Boot fastboot mode
        4. Connect the phone to the Computer
        5. Open a Command Prompt and type the following command at the prompt:
          fastboot flash boot --slot all boot.img
        6. Reboot
    7. Root/Reroot with Magisk and Pass SafetyNet.

      • Important Note(s):
        1. When doing a major upgrade i.e., Android 10 (Q) to Android 11 (R): I recommend doing a clean install. What is a clean install?
          • Doing a Factory reset prior to installing, major, update.
          • Using flash-all.bat file without removing the -w.
        2. If your phone was rooted. Do this first unhide Magisk App (if you hid it) then Uninstall Magisk - Restore Images. Why? The changes in the Factory image may cause Magisk modules to fail. This will cause boot loops.
      • Download files:

        1. Magisk App - Download to your phone
          1. Magisk Beta/Stable App
          2. Magisk Canary App
        2. Custom kernels - Download to your phone - install with Kernel Manager
          • Important Note(s): Unless otherwise directed by Kernel Devloper, Flash the Kernel after Magisk.
          1. [KERNEL] [Nov 17] Pixel 5 ElementalX by flar2
          2. [KERNEL] CleanSlate R2.7.12/S3.7.9 |S2S|Gamma|KCal|AdBlock|VIB|WrGrd [Jul 15]
          3. [Kernel]FrankenKernel[P5] by dabug123
          4. [Kernel][08.07.2021][4.14.238][A11/A12 BETA 2] Kirisakura 7.9.0 for Pixel 4/XL aka FLORAL by Freak07
        3. Kernel Manager - Download to your phone
      • Patching the boot.img

        1. Do #6 - Extract boot.img
        2. Install Magisk (Beta or Canary) App
        3. Open Magisk App
        4. Depending on the version of Magisk App installed: Set the Update Channel to Beta or Canary.
        5. Tap Install (next to Magisk)
        6. Tap, Select and Patch a File
        7. Select the boot.img file you extracted from the latest factory image.
        8. Tap the ✓ (Check Mark)
        9. Tap Let's Go
        10. When you see done, the boot.img has been patched (magisk_patched_xxxxxx.img), and stored in the download folder.
        11. Reboot
        12. Copy the patched boot.img file to your computer's Platform-tools folder or the folder that has fastboot.exe in it.
        13. Boot fastboot mode (#1)
        14. Connect the phone to the Computer with USB cord.
        15. Open a Command Prompt (#1) in the folder you copied the patched boot.img to.
        16. Type fastboot flash boot "name of patched boot".img without the quote marks at the Prompt and press enter.
        17. Type fastboot reboot at the Prompt and press enter.
        18. Important Notes:If your phone boot loops try one of the following options:
          • Flash the 'stock' boot.img to both slots: fastboot flash boot boot.img --slot all
          • Boot Safe Mode - Press Power Off button ==> Press Power Off until you see boot Safe Mode ==> Press Ok.
      • Pass SafetyNet: MAGISK MODULE ❯ Universal SafetyNet Fix 1.1.0

        1. Download SafetyNetFix from the link above.
        2. Open Magisk Canary App
          • Tap Modules icon.
          • Tap Install from storage
          • navigate to the SafetyNetFix file
          • Hightlight the file (tap it)
          • Tap the check mark (✓) to start the installation.
          • After it installs tap the Save icon to save the log
          • Tap Reboot.
        3. Open Magisk Canary App
          • Tap the Setup icon.
          • Scroll down to Magisk - MagiskHide and enable it.
          • Tap back arrow => tap Superuser icon => tap MagiskHide => Scroll to the bottom of the page => Tap Search icon => Tap Show system apps (Under Filters) => check (✓): Google play services (com.google.android.gms).
          • Close Magisk Manager.
        4. Open Settings
          • Tap Apps & notifications
          • Tap see all 999 apps
          • Tap the three dot menu
          • Tap Show system
          • Scroll down to Google Play Store
          • Tap it
          • Tap Storage & cache
          • Tap Clear cache
          • Tap Clear storage
          • Exit settings
          • reboot
        5. Open Google Play Store app
          • Tap Menu
          • Tap Settings
          • Scroll down to Play protect certification
          • check for Device certification.
    8. Set Magisk App Update Channel/Update Magisk

      • Set Magisk App Update Channel

        • Open Magisk App > Tap Settings icon > Update Channel > Select Stable, Beta, Canary or Custom.
      • Update Magisk

        1. When Magisk App notifies you of an update:
        2. Tap install.
        3. Select, Direct Install (Recommended)
        4. When it finishes installing
        5. Tap, Save Log
        6. Log location: /storage/emulated/0/Download
        7. Tap, Reboot
        8. Done!
    9. Custom ROMs

    10. Apps/Mods/Scripts/Tethering/Themes
    11. T.W.R.P. Backup/Restore

      • Android 11 (R) T.W.R.P. - Testing
    4
    @Homeboy76 Just wanted to give you a heads up. With the latest Magisk Beta (21.2) that came out yesterday, the patched output file is no longer named "magisk_patched.img". He added a suffix to the name so each time you patch the stock boot image a different output name will result. Thought you might want to modify #7 to address this change (y)
    2
    I used this guide to root my 4xl yesterday. It went well until it booted to home screen. The screen was unresponsive to touch. Buttons worked. How is that even possible?

    Flashed the factory boot.img and restarted. Working touchscreen, but of course no root.
    Sounds like an issue with magisk. Are you running the canary version? Latest platform tools? Also 3rd party launchers have been a little glitchy.
    2
    So, I've been out of the flashing game for a long minute but I had to do something about all the ads I was getting. Blockada seemed to work okay but always left something to be desired. I missed Adaway, so....

    I had a hard time getting Magisk installed in Android 11 on my Pixel 4xl. I followed this well written tutorial to a tee but when I flashed magisk_patched.img to boot, then "fastboot reboot," it would kick me back to fastboot after the "G" screen and spit out the error "no valid slot to boot." Three times in a row after clean flashing the factory image too!

    I did end up getting it working. What I ended up doing was instead of "fastboot flash boot magisk_patched.img --slot all" I "fastboot flash boot magisk_patched.img" and for whatever reason that seemed to work.

    I did not take the OTA update if it matters. I had intended to wipe the device with a clean install of Android 11, then Magisk (just for ad blocker) from the get so, I'm guessing slot b wasn't used? I'm honestly not really sure how it works.

    Even then though, I had some trouble getting the order right from flashing the factory image to being rooted, so this is also what I found.

    First, unlock the bootloader of your device, then clean install Android 11 and get it set up. Download Magisk manager canary, then adb push the boot.img from your computer to your device. Use Magisk manager to patch it, then adb pull magisk_patched.img back to your computer. From there, fastboot flash boot your magisk_patched.img and you're golden. Fastboot reboot should put you back in to Android and then Magisk manager will recognize root.

    I had tried several times to use a boot.img I had already patched some days earlier but it never seemed to work. It would boot okay, once I figured out not to "--slot all," but Magisk would never recognize it was rooted unless Magisk manager patched it and I flashed that particular patched file. If I tried to flash any other patched file, Magisk manager wouldn't recognize root. Even recently patched boot.img's that were flashed to the device (not the days old one I had pre-prepped) wouldn't work. Magisk manager only seemed to recognize patched boot.img's that were made by it in that particular install. If I tried to use a boot.img from any other Magisk Manager install it wouldn't recognize it. Weird? I dunno, but, I got it up and running!

    Thanks Homeboy76 for making this tutorial. Without it I would have been lost. :good:
    2
    This is why I follow this thread. It keeps me out of trouble. But now I wonder what it will be called. I suppose I could patch one and find out. I'm going to have to do it in about 6 days anyway, I will find out then.
    It will be magisk_patched.xxxxxxx.img. The xxxxx suffix will change every time you patch your boot image, even if patching the same boot image.