Android: The easy way to root

CHEN SU
4 min readJun 26, 2021

The story starts with the use case that I would like to explore the file system in Android devices for some work related stuffs. But in adb shell, normal commands don’t work. “su” or “sudo” shows “inaccessible or not found”.

I need to root it! I’ve done root a long time ago, totally forgot how to do it. So did some research on what’s the fashion nowadays (2021).

Thanks to this Youtube tutorial, I was able to root 2 Pixel phones.

In this article, I’ve put together extra detailed steps on how I did it.

Step 1: Settings => Developer Options => Enable OEM Unlocking

Step 2: Install AirDroid app

  • Install the app from Play store, open, select “AirDroid Web”, find the LAN ip address
  • Open Chrome, type in the ip address, accept the popup on phone, and you have the device management page available.

Step 3: Download Magisk apk and install

  • Download the apk from the official link
  • Drag the apk to AirDroid’s App tab
  • Follow the popup on phone to finish the installation of Magisk

Step 4: Download Factory Image

  • Find the corresponding factory image to your phone
  • For example: Pixel XL
  • Unzip marlin-qp1a.xxx.zip
  • Unzip image-marlin-qp1a.xxx.zip
  • Upload boot.img to phone’s download folder using AirDroid

Step 5: Patch file to generate an image file

  • Open Magisk on phone
  • Choose “Install”, choose “Select and Patch a File”, choose boot.img in Download folder
  • This step creates an img file in Download folder (e.g. magisk_patched-23000_KTI5h.img)
  • Use AirDroid’s Folder feature to download the img file to computer’s local file system (e.g. ~/Downloads/magisk_patched-xxx.img)

Step 6: Bootloader Mode

  • It might be a little bit different on different devices, feel free to try out the following commands
  • Run “adb devices” to make sure your device is connected via USB debugging
  • Run “adb reboot bootloader”
  • Your phone will enter Bootloader Mode, at first it shows “Device state: locked”, use volume button to navigate to option “Unlock the bootloader”, and press the button to apply. Your phone will restart. Explore this process until you see “Device state: unlocked” in Bootloader Mode.

Step 7: fastboot

  • Run “fastboot devices”
  • Run “fastboot flash boot ~/Downloads/magisk_patched-xxx.img”
  • Run “fastboot flashing unlock”
  • Explore those commands, your phone will reboot and install the new image, might take 10, 20 minutes or more.

Step 8: Last 1 Mile Step which should not be skipped

  • Once the OS installation finishes, go through the welcome setup for the phone
  • Open Magisk again, pops up “Upgrade to full Magisk to finish the setup. Download and install?”, continue to install the upgrade.
  • Open Magisk and pops up “Requires Additional Setup”, click OK and wait for reboot finishes, you are all set with the root.

Step 9: Double check root status with Root Checker app

  • “Congratulations! Root access is properly installed on this device!”
  • If you don’t see this, there must be some steps missed, or it might be due to the device not compatible with this workflow of rooting.

Step 10: Enjoy the root privilege!

Hopefully this article helps! Cheers!

--

--