Quick steps
- Download Google's SDK Platform-Tools for your computer and unzip it.
- On the phone, turn on USB debugging in Developer options.
- Open a terminal in the
platform-toolsfolder and runadb devices. - Tap Allow in the Allow USB debugging? prompt on the phone.
- To test fastboot, run
adb reboot bootloader, thenfastboot 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
Download Platform-Tools
Open Google's Platform-Tools page, download SDK Platform-Tools for Windows and accept the terms.
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.Open a terminal in the folder
Open the folder in File Explorer, click the address bar, type
cmdand press Enter. A Command Prompt opens in that folder. In PowerShell or Windows Terminal, start each command with.\, for example.\adb devices.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.
Optional: add it to PATH
To run
adbfrom any folder, search Windows for Edit the system environment variables, open Environment Variables, select Path, choose Edit and addC:\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:
| Distribution | Command |
|---|---|
| Debian, Ubuntu, Linux Mint | sudo apt install adb fastboot |
| Fedora | sudo dnf install android-tools |
| Arch Linux | sudo 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
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.
Connect and allow the computer
Connect the phone with a USB cable that carries data. Some cheap cables only charge. Run:
adb devicesThe phone asks Allow USB debugging? Tick Always allow from this computer and tap Allow.
Check the result
Run
adb devicesagain. 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.Test fastboot
Restart into the bootloader and check that fastboot sees the phone:
adb reboot bootloaderfastboot devicesRun
fastboot rebootto go back to Android.
Commands you'll use with Magisk
| Command | What it does |
|---|---|
adb devices | Lists connected phones |
adb reboot bootloader | Restarts the phone into the bootloader (fastboot mode) |
adb pull /sdcard/Download/file.img | Copies a file from the phone to the computer |
adb push file.img /sdcard/Download/ | Copies a file from the computer to the phone |
fastboot devices | Lists phones in fastboot mode |
fastboot flash init_boot file.img | Flashes an image to a partition, here init_boot |
fastboot reboot | Restarts 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.
Share this guide
More Magisk guides
All guides- 16 min readDownload Magisk Manager Latest Version 31.1 For Android 2026Download Magisk 31.1, the official APK from GitHub, and root your Android phone step by step. Patch your firmware, manage root access, update or uninstall.Read the guide
- 5 min readHow to Unlock the Bootloader on AndroidUnlock your Android bootloader before rooting with Magisk: what it erases, the fastboot commands, and the steps for Pixel, Xiaomi, Motorola, OnePlus and more.Read the guide
- 4 min readDownload Magisk Beta 31.1 Latest Version For Android 2026Get the newest Magisk beta from the official GitHub pre-releases, switch the Magisk app to the beta channel, and go back to stable if something breaks.Read the guide
- 4 min readHow to Uninstall Magisk From Android [2 Easiest Methods]Remove Magisk and root from your Android phone: uninstall from the Magisk app in one tap, use TWRP if the app won't open, or flash the stock boot image.Read the guide