Complete Rooting Tutorial

Universal Magisk Installation Guide

A step-by-step guide for installing Magisk on any Android smartphone or tablet. Understand method selection, pre-installation prerequisites, boot image patching, Fastboot flashing, and post-installation environment setup.

Choose Your Installation Method

  • Method A: Direct Fastboot Patching (Recommended for 95% of devices): Google Pixel, OnePlus, Xiaomi, POCO, Motorola, Nothing Phone, Asus, Sony. Uses standard Fastboot CLI to flash patched init_boot.img or boot.img.
  • Method B: Samsung Odin AP Flashing: Samsung Galaxy S, A, Note, Z Fold, and Z Flip devices. Patches full AP tarball and flashes in Odin. See our dedicated Samsung Galaxy Root Guide.
  • Method C: Custom Recovery (Legacy): Renaming Magisk-v30.7.apk to Magisk-v30.7.zip and flashing in TWRP. (Only recommended for older Android 7–10 devices without dynamic partitions).

Pre-Installation Checklist & Diagnostics

  1. Unlock the Bootloader: Ensure your device bootloader is fully unlocked. Unlocking triggers a complete factory reset.
  2. Install Android SDK Platform Tools: Download official ADB and Fastboot from Google and ensure adb devices and fastboot devices communicate with your phone.
  3. Match Your Exact Build Number: Extract stock boot images exclusively from the firmware build currently installed on your device (Settings -> About Phone -> Build Number).
  4. Battery Level: Ensure device battery charge is at least 50%.

Step-by-Step Installation Walkthrough: Fastboot Method

Step 1: Install Magisk App & Transfer Stock Boot Image

ADB Commands: App Install & Image Push
# 1. Install Magisk v30.7 APK $adb install -r Magisk-v30.7.apk # 2. Push extracted stock boot or init_boot image to Download folder $adb push init_boot.img /sdcard/Download/

Step 2: Patch Image in Magisk App

  1. Open the Magisk App on your device.
  2. Tap Install on the Magisk card.
  3. Select "Select and Patch a File" and choose your transferred image file.
  4. Tap "LET'S GO!" and wait 15–30 seconds for Magisk to repack the ramdisk into magisk_patched_[random].img.

Step 3: Pull Patched Image to PC

ADB Pull Command
$adb pull /sdcard/Download/magisk_patched_*.img magisk_patched.img

Step 4: Flash via Fastboot

Fastboot Terminal Commands
# Reboot device into Fastboot Mode $adb reboot bootloader # For Android 13+ GKI devices (Pixel 7/8/9, OnePlus 11/12, Xiaomi 13/14, etc.): $fastboot flash init_boot magisk_patched.img # For Android 12 and older devices (Pixel 6, OnePlus 10, POCO X3 Pro, etc.): $fastboot flash boot magisk_patched.img # Reboot into Android $fastboot reboot

Step 5: Post-Installation Environment Setup

When Android boots up, connect to Wi-Fi and open the Magisk App. The app will detect the newly running daemon and display:
"Additional Setup Required: Magisk requires additional setup to work properly. Do you want to proceed?"

Tap OK. Magisk will extract internal companion applets, configure SELinux rules, and reboot your device automatically. After this reboot, Magisk is 100% installed and fully functional!

Source & Verification Standard

Last updated: September 23, 2026 • Checked against: Magisk v30.7 • Primary upstream: topjohnwu/Magisk. Primary reference: topjohnwu/Magisk on GitHub.

Windows USB Fastboot Drivers & Troubleshooting

On Windows 10 and 11, the fastboot command line may display < waiting for any device > indefinitely if the proper OEM Android bootloader USB interface drivers are not installed.

To resolve driver recognition issues:

  • Install Google USB Drivers: Download the official Google USB Driver package and install it via Windows Device Manager under "Android Device → Android Bootloader Interface".
  • Use USB 2.0 Ports or Hubs: Modern AMD Ryzen and Intel USB 3.1/3.2 ports frequently exhibit protocol negotiation handshake bugs in Fastboot mode. Connecting your phone through a USB 2.0 port or non-powered USB 2.0 hub reliably resolves connection drops.
  • Verify Fastboot Connectivity: Run fastboot devices in your command prompt. It should return your phone's serial number followed by fastboot before you execute any flash commands.