Magisk Manager

Quick steps

  1. Download Google's SDK Platform-Tools for your computer and unzip it.
  2. On the phone, turn on USB debugging in Developer options.
  3. Open a terminal in the platform-tools folder and run adb devices.
  4. Tap Allow in the Allow USB debugging? prompt on the phone.
  5. To test fastboot, run adb reboot bootloader, then fastboot devices.

What are ADB and fastboot?

ADB (Android Debug Bridge) talks to your phone while Android is running. You use it to copy files, install apps and restart the phone into other modes.

Fastboot talks to the phone's bootloader. You use it to unlock the bootloader and to flash images, such as the boot image that Magisk patches.

Both come in Google's free SDK Platform-Tools package. Download it only from Google. "Minimal ADB" packs from other sites are often outdated, and some have been bundled with unwanted software.

Install ADB and fastboot on Windows

  1. Download Platform-Tools

    Open Google's Platform-Tools page, download SDK Platform-Tools for Windows and accept the terms.

  2. Unzip it

    Extract the zip to a short path such as C:\platform-tools. Long paths and folder names with special characters can cause errors.

  3. Open a terminal in the folder

    Open the folder in File Explorer, click the address bar, type cmd and press Enter. A Command Prompt opens in that folder. In PowerShell or Windows Terminal, start each command with .\, for example .\adb devices.

  4. Install the USB driver

    Windows usually installs a driver automatically. If it doesn't, install the Google USB Driver for Pixel phones, or your phone maker's USB driver for other brands.

  5. Optional: add it to PATH

    To run adb from any folder, search Windows for Edit the system environment variables, open Environment Variables, select Path, choose Edit and add C:\platform-tools. Open a new terminal afterwards.

Install ADB and fastboot on macOS

The easiest way is Homebrew:

brew install --cask android-platform-tools

Without Homebrew, download SDK Platform-Tools for Mac from Google's Platform-Tools page, unzip it, open Terminal in the platform-tools folder and start each command with ./, for example ./adb devices. Macs don't need a USB driver.

Install ADB and fastboot on Linux

Most distributions package both tools:

DistributionCommand
Debian, Ubuntu, Linux Mintsudo apt install adb fastboot
Fedorasudo dnf install android-tools
Arch Linuxsudo pacman -S android-tools

These packages can lag behind Google's releases. If fastboot fails on a newer phone, download SDK Platform-Tools for Linux from Google's Platform-Tools page and run ./adb and ./fastboot from the unzipped folder.

If adb devices says no permissions, your user isn't allowed to access the phone over USB. On Debian and Ubuntu, the android-sdk-platform-tools-common package adds the rules that fix this. Unplug and reconnect the phone afterwards.

Connect your phone

  1. Turn on USB debugging

    Turn on Developer options (tap Build number seven times in Settings → About phone), then turn on USB debugging in Developer options.

  2. Connect and allow the computer

    Connect the phone with a USB cable that carries data. Some cheap cables only charge. Run:

    adb devices
    

    The phone asks Allow USB debugging? Tick Always allow from this computer and tap Allow.

  3. Check the result

    Run adb devices again. Your phone's serial number should be listed with the word device. If it says unauthorized, unlock the phone's screen and accept the prompt.

  4. Test fastboot

    Restart into the bootloader and check that fastboot sees the phone:

    adb reboot bootloader
    
    fastboot devices
    

    Run fastboot reboot to go back to Android.

Commands you'll use with Magisk

CommandWhat it does
adb devicesLists connected phones
adb reboot bootloaderRestarts the phone into the bootloader (fastboot mode)
adb pull /sdcard/Download/file.imgCopies a file from the phone to the computer
adb push file.img /sdcard/Download/Copies a file from the computer to the phone
fastboot devicesLists phones in fastboot mode
fastboot flash init_boot file.imgFlashes an image to a partition, here init_boot
fastboot rebootRestarts the phone into Android

The full steps for rooting are in the main guide: how to root your phone with Magisk.

Common ADB and fastboot errors

adb devices shows nothing. Try another cable and another USB port, ideally one directly on the computer rather than a hub. On the phone, set the USB mode to File transfer. On Windows, install the USB driver again.

The device shows as "unauthorized". Unlock the phone and accept the Allow USB debugging? prompt. If it doesn't appear, tap Revoke USB debugging authorizations in Developer options and reconnect.

"'adb' is not recognized as an internal or external command". Windows can't find adb. Open the terminal inside the platform-tools folder, or add it to PATH. In PowerShell, type .\adb.

"command not found: adb" on Mac or Linux. Run ./adb inside the platform-tools folder, or install the tools with Homebrew or your package manager.

ADB works, but fastboot shows nothing or says "waiting for any device". Check that the phone shows the bootloader screen. On Windows, open Device Manager while the phone is in the bootloader: if there's a device with a warning icon, update its driver and choose Android Bootloader Interface.

"Flashing is not allowed in Lock State". The bootloader is still locked. Unlock it first.

Frequently asked questions

Do I need Android Studio to use ADB?

No. Google's SDK Platform-Tools is a small separate download that contains adb and fastboot. You don't need Android Studio or the full Android SDK.

Is it safe to use ADB?

Yes. ADB and fastboot are Google's official tools. USB debugging lets a computer you've approved control your phone, so only allow computers you trust and turn USB debugging off when you're done.

Can I use ADB over Wi-Fi?

Yes. Android 11 and newer have Wireless debugging in Developer options. Fastboot needs a USB cable on almost every phone, though, so use a cable when you install Magisk.

Why should I use the latest Platform-Tools?

Old versions of fastboot can fail on newer phones. Google updates Platform-Tools regularly, so download the latest version instead of using a copy from another site.