Step 1: Back Up Your Google Pixel
Take a complete backup of your Google Pixel 7 or Pixel 7 Pro and save it to your PC or cloud storage. Don’t know what to back up or how to back up your Android phone? Read our detailed guide on how to take a full backup of any Android device.
Step 2: Enable USB Debugging and OEM Unlocking On Your Pixel
To unlock the bootloader on your Google Pixel 7 or Pixel 7 Pro, you must turn on the USB Debugging and OEM unlocking options. The USB Debugging option helps create a successful ADB connection between your phone and PC. Both options can be found inside the Developer options menu, which is hidden by default on all Google Pixel phones. Here’s how to enable Developer options:
- Open the Settings app on your phone.
- Click About phone.
- Tap 7 times on the build number. It will unhide the Developer options menu.
- Go back to the Settings page.
- Tap on System and click Developer options.
On the Developer options page, find USB debugging and OEM unlocking. Enable the two options and move on to the next step.
Step 3: Install Android SDK on Your PC
You’ll need to install the Android SDK Platform Tools on your computer to make an ADB connection between the two devices. It’s critical to have Android SDK Platform Tools to run ADB and Fastboot commands. Go ahead and download the Android SDK Platform Tools on your PC.
Step 4: Boot Your Google Pixel to Fastboot Mode
To boot your Google Pixel 7 or Pixel 7 Pro to the Fastboot mode, follow the steps:
1. Connect your phone to the PC through a USB cable. If a dialogue box opens on your phone to verify the ADB connection, verify it.
2. Go to the platform tools folder on your PC, type CMD in the address bar, and hit the Enter button to launch the Command Prompt.
3. Run the following command to check if the ADB connection is successful.
fastboot devices
If the command returns a random string of numbers and letters, the ADB is connection is successful. The random string is nothing but your device ID.
4. Type in the following command on the Command Prompt and hit Enter to boot the phone into the Fastboot mode.
adb reboot bootloader
Your Google Pixel should have booted to the Fastboot mode.
Step 5: Unlock the Bootloader
This is the final step you need to perform to unlock the bootloader on your Google Pixel.
1. Run the following command to unlock the bootloader:
fastboot flashing unlock
2. Your device will display a warning message. Use the volume keys to navigate to the Unlock the bootloader option, and press the power button to select it.
3. Your device will return to the Fastboot screen. Check the Device status; it should be unlocked.
4. If the device does not reboot to the system automatically, press the power button or run the following command:
fastboot reboot
You now have an unlocked bootloader on your Google Pixel.
In this step, we’ll extract the stock boot image from the factory image for your Pixel 7 or 7 Pro.
1. Go to Google’s firmware page and download the factory image for your Google Pixel.
[Important: Download the factory image for the same version installed on your device. You can navigate to Settings > About Phone > Build Number to check the current version.]
2. Extract the downloaded file on your PC.
3. Go to the Images folder and look for boot.img file. Copy this file and transfer it to your phone.
Step 7: Patch the Boot.img file via Magisk
- On your Google Pixel 7/Pro, download and install the Magisk app.
- Launch the Magisk app.
- Click the Install button next to Magisk.
- Tap on Select and Patch a File and select the boot.img file, which you transferred from the computer.
- Click on the LET’S GO button to patch the boot.img file.
The patched file will be saved to the Downloads folder on your phone. It should be named magisk_patched_boot.img. Transfer this file to your PC and move it to the platform-tools folder.
Step 8: Root Your Google Pixel (Temporarily)
While you could directly flash the patched boot.img file and root your Google Pixel, we are taking a safer approach. In this step, we’ll temporarily root your phone. This way, you can check if everything works fine on your phone and permanently root your Google Pixel.
A simple reboot will fix the issue if your device ends up in a bootloop. Rather than directly flashing the patched boot.img file, we recommend going this way to avoid many risks. Run the following command to boot your phone to a temporarily rooted OS:
fastboot boot magisk_patched.img
Step 9: Root Your Phone (Permanently)
If your Google Pixel does not run into problems while it was booted to a temporarily rooted OS, follow the steps below to complete the rooting process:
- Launch the Magisk Manager app on your phone.
- Click Install next to Magisk and select Direct Install (Recommended).
- Click LET’S GO and tap the Reboot button at the bottom right corner.
- You are done. Your Google Pixel is now rooted.
As mentioned earlier, you could have directly flashed the patched boot.img file to root your Google Pixel. But, we took a safer approach by testing the temporary rooted OS (step 8). Following is the command to directly flashed the patched boot:
fastboot flash boot magisk_patched_boot.img
[Important: Please do not run the above command if you have applied Step 8 and Step 9.]
Conclusion
Rooting an Android offers an insane level of customization. But it comes with many risks, which we discussed in this post. If you have followed all the steps in the same order, rooting a Google Pixel 7 or Pixel 7 Pro should not be difficult. However, if you encounter any errors or face issues, please let us know in the comments below. We’ll try to get back to you as soon as possible.
Starting Android 13, should we extract/ patch/ flash boot.img or init_boot.img