Installation Root: How to Root Google Pixel with Magisk or APatch
Full step-by-step guide to rooting any Google Pixel — from bootloader unlock to verified root access, using Magisk or APatch.
Before You Start
- Create a full backup of your data — bootloader unlock wipes the device
- Charge the phone to at least 70%
- Download platform-tools (adb, fastboot, and the helper scripts) from here and extract it to a folder like
C:\adb - Download the root manager APK you want to use from deviceschanger.org/software — Magisk or APatch
- Install the Google USB driver if it is not already installed
- Enable Developer options, USB debugging, and OEM unlock
- Use a known-good USB cable (data cable, not charge-only)
Important: Unlocking the bootloader erases all data and may affect warranty status. Proceed at your own risk.
Step 1 — Unlock the Bootloader
- Enable Developer options: Settings → About phone, tap Build number 7 times
- In Settings → System → Developer options, enable OEM unlocking and USB debugging (the device must be connected to the internet for OEM unlocking to activate)
- Connect the phone to your PC and authorize the USB debugging prompt
- Run the
Unlock_bootloader.batscript from the platform-tools folder, or do it manually:
adb reboot bootloader
fastboot devices
fastboot flashing unlock
The script asks you to choose the unlock method: 1 for fastboot flashing unlock (Pixel 6 and newer) or 2 for fastboot oem unlock (older devices).
Note: Confirm the unlock on the phone using the volume and power keys. The phone reboots and performs a factory reset. Complete initial setup again before continuing.
Step 2 — Download the Factory Image
- Check your current build number: Settings → About phone → Build number
- Go to developers.google.com/android/images
- Find your device model and download the factory image matching your exact build number
- Extract the downloaded
.ziparchive on your PC
Important: The image must match the build currently installed, or the device may fail to boot.
Step 3 — Extract the Right Image
Inside the extracted factory image, locate the correct image file. The partition depends on both your device and your root method:
- Magisk — Pixel 6 and older:
boot.img; Pixel 7, 8, 9, 10 (and Fold):init_boot.img - APatch — always
boot.img, on every device. Never patch or flashinit_bootwith APatch.
Step 4 — Patch the Image
Option A — Magisk
- Install the Magisk APK (download from deviceschanger.org/software)
- Transfer the extracted
boot.imgorinit_boot.imgto the phone'sDownloadsfolder - Open Magisk, tap Install, then Select and Patch a File
- Select the image file — Magisk patches it and saves
magisk_patched_*.imginDownloads - Transfer the patched image back to your PC (into the platform-tools folder)
Option B — APatch
- Install the APatch APK (download from deviceschanger.org/software)
- Transfer the extracted
boot.imgto the phone'sDownloadsfolder - Open APatch, tap the button in the top-right corner, then Select a boot image to patch
- Set a strong SuperKey and wait for patching to finish
- The patched image is saved as
apatch_patched_*.imginDownloads— transfer it back to your PC
Important: APatch always patches boot.img. Do not patch or flash init_boot with APatch — it can cause a bootloop.
Step 5 — Flash the Patched Image
- Reboot to bootloader:
adb reboot bootloader - Verify detection:
fastboot devices - Run the
Flash_Magisk_or_APatch.batscript from the platform-tools folder, or flash manually:
# Magisk — Pixel 6 and older (boot partition)
fastboot flash boot magisk_patched.img
# Magisk — Pixel 7, 8, 9, 10 (init_boot partition)
fastboot flash init_boot magisk_patched.img
# APatch — always boot partition, every device
fastboot flash boot apatch_patched.img
The script asks for the image file name and the partition (1 for boot, 2 for init_boot), then flashes it automatically.
- Reboot:
fastboot reboot
Step 6 — Verify Root Access
- Open the root manager app after reboot (Magisk or APatch)
- Confirm it shows the app is installed with a version number
- Optionally run a root checker app to confirm superuser access
Partition Reference Table
| Root method | Device | Partition | Flash command |
|---|---|---|---|
| Magisk | Pixel 6 and older | boot | fastboot flash boot |
| Magisk | Pixel 7 / 8 / 9 / 10 | init_boot | fastboot flash init_boot |
| Magisk | Pixel Fold series | init_boot | fastboot flash init_boot |
| APatch | All Pixel devices | boot | fastboot flash boot |
Troubleshooting
Device not detected in fastboot
- Install the Google USB driver
- Try a different USB cable or port
- Check Device Manager for unrecognized devices
Wrong build number
- Re-download the factory image matching the exact build on the phone
- Re-extract and re-patch the correct image
Bootloop after flashing
- Flash the original (unpatched) image to restore boot
- Verify you flashed to the correct partition (boot vs init_boot)
- For APatch: confirm you patched
boot.img, notinit_boot.img
Related pages
Installation guide · LSPosed module · Root hide · Play Integrity fix · Device simulation · Software downloads