How to install OTA updates and keep root on your Google Pixel phone

Part of the beauty of owning a Google Pixel phone is the proper availability of firmware images that can be used to factory reset the device. Even if you unlock the bootloader, root the phone, or tinker a bit too much, you might be looking for a last resort to restore the default configuration before taking the monthly security updates. While many hardcore Android fans know exactly what to do, not everyone is so adept at updating their phone without losing root.

If you have access to a PC/Mac and like to take matters into your own hands, you can easily retain root access by following a few extra steps on top of sideloading the OTA update on your Google Pixel. In this tutorial we will show you how.

Navigate this article:

Pixel 6 Pro with flower background on windowsill



How rooting affects the ability to install OTA updates

Rooting modifies parts of the Android boot image to gain superuser access. A regular monthly OTA or “over-the-air” update is incremental by nature, which means it cannot apply the delta patch to update the stock boot image as it is in a rooted environment there is an apparent binary discrepancy. While opting for the full update package is a viable solution to this problem, it eventually overwrites the bits and parts required for root access from the boot partition.

For those of you planning to get dirty with your Pixel and might need a savior down the road, we thought we’d make sure you know how to maintain root access across monthly security updates. The process is not difficult, but it does require some ADB and Fastboot commands.


Here’s how to stay root and make OTA updates on your Pixel

Before you start, note that this tutorial assumes you have an unlocked bootloader and are already rooted with Magisk. Also, make sure you have the latest ADB and Fastboot binaries installed on your PC/Mac and that the target device can be detected by these tools.

There are a few ways to get your Pixel update to the latest official Android build while staying root. You can restore the base version stock boot image, wait for your phone to get a notification asking you to download any pending updates to your phone (or manually sideload the update), then the updated boot image patch and flash it. This is a bit slower but recommended method for beginners.

A relatively faster method to get the latest update on your Google Pixel while remaining root is to flash the official factory image with a pre-patched boot image. Keep in mind that both methods rely on access to a PC or Mac. None of them require you to wipe the device, but it’s good practice to back up any irreplaceable data in case something goes wrong.

  1. Locate the exact version number of the currently installed software on your Google Pixel phone. Navigate to settings > Via phone and write down the text below that build number Section.
  2. Now we need to restore the pristine boot image that matches the installed build. As a precaution, open Magisk, switch to modules disable the active modules and reboot once before.
    • Depending on the patching method, the Magisk app may keep a backup copy of the stock boot image. If so, you should be able to restore them from the restore images option under the after Uninstall Magisk app menu. Nonetheless, we recommend flashing the unmodified boot.img from the factory image to avoid unforeseen problems.
  3. Download the fastboot flashable factory image corresponding to the latest Android build number for your Google Pixel phone on your PC/Mac. It should be named as <device codename>-<build number>-factory-<hash value snippet>.zip.
  4. Open the factory image with your favorite archive manager, locate the image-<device codename>-<build number>.zip file (yes, there is a zip file within a zip file) and extract the boot.img file from it.
    Google Pixel 6a firmware stock boot image
  5. Install the stock boot.img for the current Android build number:
    1. Make sure USB debugging is enabled on the phone and the adb devices Command on the computer returns the phone’s serial number.
    2. Restart the phone in bootloader mode: adb reboot bootloader
    3. Flash Stock Boot Image: fastboot flash boot <full patch of the stock boot.img>
    4. restart: fastboot reboot
  6. You can now force your phone to get any pending updates by going to settings > system > system update > Check for updates. Alternatively, download and manually sideload the latest flashable full OTA recovery image for your model.
    • Do not select the latest factory image for the upgrade as the inbox flash script will wipe the device by default.
  7. Now that you’re on the latest build, it’s time to patch the boot image with Magisk to regain root access. We have a dedicated tutorial on installing Magisk, so check it out if you need help.
  8. Once your phone has rebooted after flashing the patched boot image, you should be sure to be updated with the latest OTA with root access.


Fast method

  1. Download the factory image corresponding to the latest update for your Pixel phone to your PC/Mac. You can do this either through Google’s download portal or through our Android 13 download index.
  2. Unpack the factory image using your favorite archive manager, locate the file image-.zip and extract the boot.img file from it.
  3. Patch the default boot image with Magisk, but don’t flash it on your phone just yet.
  4. Copy the Magisk patched boot image from your phone to your PC/Mac and rename it to boot.img.
  5. open that image-<device codename>-<build number>.zip File from step 2 with the archive manager of your choice and replace the stock boot image file in it with the one from step 4.
  6. To remove the data wipe routine, change the flash script as follows:
    • If you’re using Windows, open the “flash-all.bat” file with Notepad (or your favorite text editor), remove the “-w” parameter from the flashing Fastboot segment, and save the file.
    • For Linux and macOS, open the file named “flash-all.sh” with your favorite text editor, remove the “-w” parameter from the flashing Fastboot segment, and save the file.
  7. Reboot your Pixel phone into bootloader mode and flash with Fastboot.
  8. If everything goes right, the phone should automatically reboot to the latest OS version – also with a preinstalled boot image.

Google Pixel 6a running Android 13 Oct 2022 build rooted with Magisk

Don’t have access to a computer? While it’s possible to instruct Magisk to install itself on the inactive slot before taking an incremental OTA and remaining root after the update, you might encounter some unexpected obstacles in the process. We therefore recommend patching the boot image yourself and flashing it with a PC.


examination

An easy way to check that you’ve followed all of these steps correctly is to go to settings > Via phone > Android version. You should see the exact patch and build number that you sideloaded onto your Google Pixel device.

Next, open the Magisk app from the app drawer and the Magisk build number should be listed next to the “Installed” parameter, indicating you’ve successfully completed the process.



If you have any questions about rooting your Google Pixel phone, make sure to leave them in the comment section below.

Leave a Reply

Your email address will not be published. Required fields are marked *