← Back to home

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/softwareMagisk 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

  1. Enable Developer options: Settings → About phone, tap Build number 7 times
  2. In Settings → System → Developer options, enable OEM unlocking and USB debugging (the device must be connected to the internet for OEM unlocking to activate)
  3. Connect the phone to your PC and authorize the USB debugging prompt
  4. Run the Unlock_bootloader.bat script 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

  1. Check your current build number: Settings → About phone → Build number
  2. Go to developers.google.com/android/images
  3. Find your device model and download the factory image matching your exact build number
  4. Extract the downloaded .zip archive 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 flash init_boot with APatch.
Pixel boot vs init_boot partition reference

Step 4 — Patch the Image

Option A — Magisk

  1. Install the Magisk APK (download from deviceschanger.org/software)
  2. Transfer the extracted boot.img or init_boot.img to the phone's Downloads folder
  3. Open Magisk, tap Install, then Select and Patch a File
  4. Select the image file — Magisk patches it and saves magisk_patched_*.img in Downloads
  5. Transfer the patched image back to your PC (into the platform-tools folder)

Option B — APatch

  1. Install the APatch APK (download from deviceschanger.org/software)
  2. Transfer the extracted boot.img to the phone's Downloads folder
  3. Open APatch, tap the button in the top-right corner, then Select a boot image to patch
  4. Set a strong SuperKey and wait for patching to finish
  5. The patched image is saved as apatch_patched_*.img in Downloads — 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

  1. Reboot to bootloader: adb reboot bootloader
  2. Verify detection: fastboot devices
  3. Run the Flash_Magisk_or_APatch.bat script 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.

  1. Reboot: fastboot reboot

Step 6 — Verify Root Access

  1. Open the root manager app after reboot (Magisk or APatch)
  2. Confirm it shows the app is installed with a version number
  3. Optionally run a root checker app to confirm superuser access
Pixel root process flow diagram

Partition Reference Table

Root methodDevicePartitionFlash command
MagiskPixel 6 and olderbootfastboot flash boot
MagiskPixel 7 / 8 / 9 / 10init_bootfastboot flash init_boot
MagiskPixel Fold seriesinit_bootfastboot flash init_boot
APatchAll Pixel devicesbootfastboot 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, not init_boot.img

Related pages

Installation guide · LSPosed module · Root hide · Play Integrity fix · Device simulation · Software downloads

Open Installation Guide Get access