Skip to main content

Android Device Setup

If you don't already have the Android Platform tools, ensure that you install them now.

Search the brew packages for the appropriate Android build tools:

# search for the package:
brew search android

# install the appropriate package:
brew install android-platform-tools

After the package is installed, ensure that you have the adb and fastboot commands available.

Rooting the Device

Google is more open to rooting the device than Apple is with jailbreaking. Specifically, the Pixel line is well known to be rootable if you purchase one directly from Google. However, if you get the device from a cellular carrier there is a good chance that it is not rootable.

Essentially, to root an Android device you must be able to unlock the bootloader. Once it is unlocked, you can then use Magisk to patch the boot.img file from the factory images, and then flash that to the bootloader.

Below is a simple example using a Pixel 6:

  • On the device, unlock the bootloader. This is done in the Settings app. Select the About page, then tap on the Build number 7 times. Then go back one level and select System => Developer options. Scroll down to OEM unlocking and toggle the switch to on.

  • Download the proper factory image for your device and the Android version you have. This link is for the Nexus & Pixel lines: https://developers.google.com/android/images

  • Extract the main zip file, then look for another zip file named image-(devicecodename)*.zip. Unzip this file as well. Inside will be the boot.img file.

  • Download the Magisk APK file from https://github.com/topjohnwu/magisk/releases/

  • Next, push the boot.img file to the device using adb and then install the Magisk APK:

    adb push boot.img /sdcard

    adb install Magisk-v29.0.apk
  • On the device, launch the Magisk app. On the Home tab, tap on the Install link at the top, then select the boot.img and allow it to patch it. This will create a new .img file in the same location.

  • Pull the patched .img file back to your computer.

    adb pull /sdcard/Download/magisk_patched_(random).img
  • Flash the patched .img file to the device

    adb reboot bootloader

    fastboot flash boot magisk_patched_(random).img
    fastboot reboot

Magisk

In progress...

Magisk Modules

In progress...