How to install OTA updates and keep root on your Google Pixel phone
How to install OTA updates and keep root on your Google Pixel phone
Part of the beauty of owning a Google Pixel phone it comes through the proper availability of firmware images that can be used to restore the device to its factory state. Even if you unlock the bootloader, root your phone, or you’re playing around a bit, you may find yourself looking for a last resort to restore your stock configuration before downloading the monthly security updates. While many hardcore Android fans will know exactly what to do, not everyone is as adept at updating their phone without losing root.
If you have access to a PC/Mac and like to take things into your own hands, you can easily maintain root access by performing a few extra steps in addition to sideloading OTA updates to your Google Pixel. In this guide, we’ll show you how.
Navigate this article:
How rooting affects the ability to install OTA updates
Rooting involves modifying parts of the Android boot image to gain superuser access. The regular monthly OTA or “over-the-air” update is incremental in nature, meaning it cannot apply a delta patch to upgrade the stock boot image due to an apparent binary mismatch in the root environment. While choosing the full update package is a viable solution to this problem, it will end up overwriting the bits and pieces needed for root access from the boot partition.
So for those of you who plan to get down and dirty with your Pixel and may need a rescue along the way, we thought we’d make sure you know how to maintain root access through monthly security updates. The process is not difficult, but it requires a few ADB and quick launch commands.
How to keep root and download OTA updates on your Pixel
Before starting, please note that this guide assumes you have an unlocked bootloader and are already rooted with Magisk. Moreover, 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 several ways to update your Pixel to the latest official Android version while still rooting. You can restore the base boot image, wait until your phone gets a notification asking you to download pending updates to your phone (or download the update manually), then patch the updated boot image and flash it. This is a slightly slower but recommended method for beginners.
A relatively faster way to get the latest update on your Google Pixel while keeping root is to flash an official factory image with a pre-patched bootable image. Note that both methods rely on access to a PC or Mac. None of them require you to wipe the device, but it’s a good practice to do so back up all irreplaceable data in case something goes wrong.
Recommended method
- Find the exact version number of the currently installed software on your Google Pixel phone. Navigate to Settings > About the phone and note the text below Build number section.
- Now we need to restore a pristine boot image that matches the installed version. As a precaution, open Magisk, switch to Modules tab, disable active modules and reboot once before doing so.
- Depending on the patching method, Magisk may keep a backup of the base boot image. In that case, you should be able to return them via road Restore images option below after Uninstall Magisk menu. However, we recommend that you flash a pristine boot.img from the factory image to avoid any unforeseen issue.
- Download the factory flashboot image that matches the current Android version number for your Google Pixel phone to your PC/Mac. It should be named as
<device codename>-<build number>-factory-<hash value snippet>.zip
. - Open the factory image using your favorite archive manager, find
image-<device codename>-<build number>.zip
file (yes, there is a ZIP within a ZIP) and extract the boot.img file from it. - Install the standard boot.img for the current Android version number:
- Make sure USB Debugging is enabled on your phone and on
adb devices
the command on the computer returns the serial number of the phone. - Reboot your phone into boot mode:
adb reboot bootloader
- Flash the stock boot image:
fastboot flash boot <full patch of the stock boot.img>
- Restart:
fastboot reboot
- Make sure USB Debugging is enabled on your phone and on
- You can now force your phone to pull any pending updates by going to the Settings > System > System update > Check for updates. Alternatively, download the latest full OTA recovery image for your model and insert it manually.
- Do not select the latest stock image to upgrade, as the inbox flashing script will wipe the device by default.
- Now that you’re on the latest build, it’s time to patch the boot image using Magisk to regain root access. We have a special tutorial for how to install Magiskso take a look if you need help.
- Once your phone reboots after restoring the patched boot image, you should be safely updated with the latest OTA with root access.
Quick method
- Download the stock image corresponding to the latest update for your Pixel phone on your PC/Mac. You can do it from Google download portal or from us Android 13 download index.
- Extract the factory image using your favorite archive manager, find the image-<šidno ime uređaja>–
.zip file and extract the boot.img file from it. - Patch the initial image using Magiskbut don’t flash it on your phone yet.
- Copy the Magisk patched boot image from your phone to your PC/Mac and rename it to boot.img.
- Open it
image-<device codename>-<build number>.zip
file from step 2 with the archive manager of your choice and replace the bootable image file in it with the one from step 4. - To remove the wipe routine, modify the flashing script as follows:
- If you’re using Windows, open the file named “flash-all.bat” 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” in your favorite text editor, remove the “-w” parameter from the flash segment and save the file.
- Reboot your Pixel phone into boot mode and perform the flashing operation using Fastboot.
- If all goes well, the phone should automatically reboot to the latest OS version – and with a pre-booted boot image.
Don’t have access to a computer? While it is possible to instruct Magisk to install on an inactive slot before taking the incremental OTA and retain root after the update, you might run into some unexpected obstacles in this process. Therefore, we recommend that you patch the boot image yourself and flash it using your computer.
Verification
An easy way to check if you’ve followed all these steps correctly is to go to the Settings > About the phone > Android version. You should see the exact patch number and version you downloaded on your Google Pixel device.
Next, open the Magisk app from the app drawer and the Magisk version number should be listed next to the “Installed” parameter, indicating that you have successfully completed the process.
If you have any questions related to rooting your Google Pixel phone, please leave them in the comment section below.
#install #OTA #updates #root #Google #Pixel #phone