How to use ADB and Fastboot on Windows, macOS, and Linux step by step

  • ADB allows your computer to communicate with Android to install apps, manage files, and run advanced commands using USB debugging.
  • Fastboot operates at the bootloader level and is used to unlock it, flash system images, and recover soft-brick devices.
  • The installation of ADB and Fastboot varies depending on Windows, macOS or Linux, but it always requires first enabling USB debugging on the mobile device.
  • Using these tools carries risks: it is essential to make backups, understand the commands, and follow best practices.

Guide to using ADB and Fastboot on Windows, macOS, and Linux

If you've ever wanted to fully customize your Android device, you've probably come across terms like ADB or Fastboot. While they may sound technical, these tools are essential for making advanced modifications to any Android phone , from removing pre-installed apps to flashing a ROM or unlocking the bootloader.

In this comprehensive guide you will find a detailed explanation of what ADB and Fastboot are , how to install them on your operating system—whether Windows, macOS or Linux—what they are used for, how to configure ADB drivers and what are the most useful commands you can safely run.

What are ADB and Fastboot and what are they used for?

Explanation of what ADB and Fastboot are

ADB (Android Debug Bridge) is a command-line tool that acts as a bridge between your Android device and your computer . It's part of the Android SDK and was originally intended for developers, but any advanced user can benefit from it.

With ADB you can communicate with the Android operating system from your PC , which allows you to do many things, including:

  • Install apps in APK format without going through Google Play.
  • Uninstall apps, including many pre-installed apps that cannot be removed from the settings.
  • Send and receive files between the computer and the mobile phone when mass storage is not working or is unavailable.
  • Access the file system and execute internal commands using adb shell.
  • Record or capture the screen from the mobile without installing additional applications.
  • Restart device in different modes (normal, recovery, bootloader).

Fastboot, on the other hand, is a low-level tool used to interact directly with the device's bootloader . Unlike ADB, it doesn't communicate with the booted Android system, but rather with the bootloader, and therefore only works when the phone is in bootloader or fastboot mode.

With Fastboot you can perform critical actions on the firmware, such as:

  • Unlock the bootloader (on compatible devices) to install recoveries or custom ROMs.
  • Flash system images (system.img, boot.img, recovery.img, etc.).
  • Manually updating a stock ROM provided by the manufacturer.
  • Recovering a soft-brick device flashing the essential components again.

Both tools are essential if you want to root your device, flash ROMs, remove bloatware, or perform tests in a development environment . However, it's important to use them with caution, as a wrong command can render your phone unusable or cause you to lose all your data.

Prerequisites: USB debugging and ADB drivers

Enable USB debugging on Android to use ADB

Before installing any tools on your computer, you need to prepare your Android device so it can communicate correctly with ADB and Fastboot. This involves two key steps: enabling USB debugging and, in the case of Windows, installing or configuring the ADB drivers.

How to enable USB debugging on Android

USB debugging allows your device to accept ADB commands from your computer . Without it enabled, ADB will only see the phone as "offline" or won't detect it at all.

The general steps to enable USB debugging are:

  1. Opens Settings> Phone information.
  2. Locate the section Build Number and tap on it seven times in a row until the message appears that you are a developer.
  3. Go back to Settings and enters System > Developer Options (the name may vary slightly depending on the manufacturer).
  4. Activate the option USB debugging.

When you connect your phone to your computer with the USB cable, you'll see a notification on your phone's screen asking you to authorize USB debugging from that computer . It's essential to accept this prompt, and if you want to avoid future confirmations, you can check the box labeled "Always allow from this computer ." If you're unsure how to enable developer options on your device, consult a tutorial specific to your brand or our article on how to enable developer options.

ADB drivers on Windows, macOS and Linux

For everything to work stably, the operating system must recognize the device as an Android terminal compatible with ADB.

  • Windows: usually requires specific drivers for some manufacturers (Samsung, Xiaomi, OnePlus, etc.) or universal ADB drivers. Many manufacturers offer them on their official website. There are also generic packages such as Universal ADB Drivers which facilitate the detection of most devices.
  • MacOS: recognizes in a native to most Android devicesTherefore, it is not usually necessary to install additional drivers.
  • LinuxMost modern distributions integrate the Android device supportIn some cases, adding rules may be useful. udev specific, but installing the ADB and Fastboot packages is usually enough.

Once USB debugging and drivers are configured, your computer will be ready to communicate with the mobile phone using ADB and Fastboot.

Installing ADB and Fastboot on Windows

Installing ADB and Fastboot on Windows

On Windows, you have several ways to install these tools. The two most common are using a simplified installer or downloading the official Android Platform Tools package.

Option 1: Minimal ADB and Fastboot

The simplest way is to download the Minimal ADB and Fastboot installer , created by the XDA Developers community. Its advantages include:

  • Include only what's necessary: adb.exe, fastboot.exe and associated bookstores.
  • Guided installation using a standard Windows wizard.
  • Compatible with systems 32 and 64 bits.

After installing it, you will have a folder (usually in C:\Program Files or similar) from which you can open a command window and run the tools.

Option 2: Official Android Platform Tools Package

Another option, recommended to always keep the latest version, is to download the official Platform Tools package from the Android Developers website . It's a ZIP file that you need to extract to a folder, for example, C:\ADB or C:\ADB\platform-tools.

The key files you will find are:

  • adb.exe – main binary of Android Debug Bridge.
  • fastboot.exe – bootloader flashing and management tool.
  • AdbWinUsbApi.dll y AdbWinApi.dll – Libraries required for ADB to work on Windows.

With this folder you can now open a console within the path and use the commands, but the most convenient thing is to add it to the system PATH to run ADB and Fastboot from any directory.

Add ADB and Fastboot to PATH in Windows

To be able to run commands from anywhere without having to navigate within the folder, you can add the path to the Environment Variables :

  1. Accede to "This team", right click and select Properties.
  2. Sign in “Advanced system settings” and choose “Environment variables”.
  3. In the “System variables” section, find and edit the variable “Path”.
  4. Add a new entry with the path to your ADB folder, for example C:\ADB\platform-tools.
  5. Save the changes by clicking OK in all windows.

After doing this, you will be able to open the console (CMD or PowerShell) from any path and use ADB without problems., simply by typing adb o fastboot without having to specify the complete route.

Configure ADB and Fastboot PATH in Windows

Installing ADB and Fastboot on macOS

Installing ADB and Fastboot on macOS

On macOS you can use the Platform Tools downloaded from the official Android website or use an automated script that simplifies the whole process and configures the PATH for you.

Installation using Nexus Tools script

There is a script hosted on GitHub that automatically installs ADB and Fastboot on macOS (and also on many Linux distributions):

bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/install.sh)

This command downloads and installs the necessary tools and add your routes to the PATHallowing you to run them from any terminal simply by typing adb o fastboot.

If in the future you wish to uninstall these tools installed by the script, there is also an uninstallation command:

bash <(curl -s https://raw.githubusercontent.com/corbindavenport/nexus-tools/master/uninstall.sh)

On macOS, no additional drivers are needed , as the system natively recognizes most Android devices. After installing Platform Tools or using the script, simply connect your phone, enable USB debugging, and start running commands.

Manual installation using Platform Tools

If you prefer to do it manually, download the Android Platform Tools ZIP file from the Android Developers website and extract it to an easily accessible folder, for example, on your Desktop in a folder called Android.

To use ADB:

  1. Open the application Bus Terminal from Applications> Utilities.
  2. Navigate to the folder where it is located adb, For example:
    cd ~/Desktop/Android/platform-tools
  3. Connect the device and run:
    ./adb devices

If you want to be able to simply write adb without the prefix ./ And from any route, you can add the folder platform-tools to the PATH in your file .bashrc, .zshrc or similar:

export PATH=$PATH:/Ruta/Completa/a/platform-tools

Installing ADB and Fastboot on Linux

Installing ADB and Fastboot on Linux

On Linux, installation is usually even simpler thanks to the package managers of each distribution. In most cases, you won't need any additional drivers for your smartphone.

The general way to install ADB and Fastboot from repositories is:

  • Debian / Ubuntu / Linux Mint / Elementary OS:
    sudo apt install android-tools-adb android-tools-fastboot
  • Debian (according to repository):
    sudo apt-get install android-tools-adb android-tools-fastboot
  • Fedora / openSUSE:
    sudo dnf install android-tools
  • Arch Linux:
    sudo pacman -S android-tools

Most modern distributions do not require installing drivers separately. Once the packages are installed, you can use ADB and Fastboot from any terminal. simply writing adb o fastboot.

If you prefer, you can also use the same Nexus Tools script mentioned for macOS, which downloads the tools directly from official sources and adds them to your PATH.

First steps: Check the ADB connection

Check devices connected with ADB

Once everything is installed, the first step should always be to verify that your computer correctly recognizes the mobile phone.

  1. Connect the device via USB (use a good quality data cable).
  2. Make sure that the USB debugging is activated and the mobile is unlocked.
  3. Open the console (CMD, Terminal or PowerShell, depending on your system).
  4. Run:
    adb devices

You will see a list with a device identifier. The most common states are:

  • deviceThe device is correctly connected and authorized.
  • unauthorized: USB debugging fingerprint not accepted on the mobile device.
  • offlineThe device is not responding or there are problems with the drivers.
  • no device: no terminal is connected or detected.

If everything is correct, you will see at least one line with the device identifier; in that case, the mobile is ready to receive ADB commands.

Main ADB commands

Terminal with ADB commands running

Below is a compilation of basic and advanced ADB commands that are most frequently used.

  • adb devices List of connected devices and its status.
  • adb shell - Open one interactive shell on the device to execute internal commands.
  • adb push archivo /ruta/destino Copy files from your PC to your mobile device to the indicated route.
  • adb pull /ruta/origen archivo Copy files from your mobile phone to your PC.
  • adb install app.apk Manually install an application in APK format.
  • adb uninstall nombre.del.paquete Uninstall an application using its package name.
  • adb reboot Reboot the device in normal mode.
  • adb reboot-bootloader – Restart directly in bootloader mode / fastboot.
  • adb reboot recovery – Restart in recovery mode.
  • adb kill-server y adb start-server They restart the ADB server if there are connection problems.

Within adb shell You can use internal utilities such as pm (Package Manager) or am (Activity Manager) to manage applications, permissions, and system activities at a much more detailed level.

Basic Fastboot Commands

Using fastboot mode on Android

Fastboot only works with the mobile in bootloader modeTo enter this mode, a key combination is usually used when turning on the device, or the command is used. adb reboot-bootloader.

Some essential Fastboot commands are:

  • fastboot devices Verify that the device is detected in bootloader mode.
  • fastboot oem unlock o fastboot flashing unlock Unlock the bootloader on many devices (it usually erases all data).
  • fastboot flash recovery recovery.img Install a custom recovery (e.g. TWRP).
  • fastboot flash boot boot.img Flash a boot image, used for modified kernels or custom ROMs.
  • fastboot flash system system.img Install a complete system from a system image.
  • fastboot flashall Automatically flashes all .img files that is in the current folder (very useful for complete stock ROMs).
  • fastboot boot archivo.img Temporarily starts an image without flashing it (ideal for testing kernels or recoveries).

Remember that Fastboot modifies the firmware , so using it without a thorough understanding of each image and command can render your device unusable or without a functional operating system.

Remove pre-installed applications (bloatware) with ADB

One of the most practical uses of ADB is to remove bloatware , that is, pre-installed applications that cannot be easily removed from system settings.

The basic process is:

  1. Meet the package name of the app you want to delete. You can use apps like APK Explorer & Editor to find out.
  2. Activate USB debugging and connect your mobile phone to the computer.
  3. Open a terminal or console and run:
adb shell
pm list packages | grep "nombre"
pm uninstall -k --user 0 nombre.del.paquete

With pm list packages You can locate the exact package and then, the command pm uninstall -k --user 0 Uninstall the application for the current user without requiring root accessThe app usually remains in the system partition, but it is no longer installed for your user, freeing up space and preventing it from running.

Advanced actions with ADB and Fastboot

In addition to basic commands, ADB and Fastboot allow you to perform much more advanced tasks that are usually used by developers, testers, and expert users.

  • Take screenshots without extra apps:
    adb shell screencap -p /sdcard/captura.png
    Then you can use adb pull /sdcard/captura.png to transfer it to the computer.
  • Record the mobile screen:
    adb shell screenrecord /sdcard/video.mp4
    Ideal for recording demonstrations or bugs without third-party applications.
  • Restart the ADB server If there are connection errors:
    adb kill-server
    adb start-server
  • Test recoveries or kernels without flashing using Fastboot:
    fastboot boot recovery.img

Likewise, internal commands such as am (to send intents to activities) and pm (to manage packages and permissions) allow force app closures, modify system components, check permissions, or automate testsThe power of these tools depends solely on your knowledge and the caution with which you use them.

Good practices, precautions and risks

ADB and Fastboot are extremely powerful, but they also carry risks if used without the proper knowledge.

  • Always make backup copies Before making any major changes, such as unlocking the bootloader, flashing a ROM, or modifying partitions, you should check your data.
  • Understand each command before executing it. Commands like fastboot flash or certain uses of pm can directly affect the system startup.
  • Use reliable USB cables and portsA disconnection during a Fastboot flash can leave the device in a critical state.
  • Consult specialized forums As XDA Developers does, you'll need to follow tutorials specific to your model. Each manufacturer implements the bootloader and fastboot mode slightly differently.
  • Consider practicing with an old device. before applying advanced processes to your main mobile phone.
  • Keep the warranty in mindMany brands believe that unlocking the bootloader voids coverage, especially if unofficial ROMs are installed.

When used correctly, ADB and Fastboot become key tools for unlocking the full potential of Android: developers, testers, and enthusiasts can automate tasks, customize the interface, test ROMs, or even revive seemingly unusable devices. Mastering these commands and understanding their implications will allow you to take your Android phone to the next level without compromising security, provided you follow the correct guidelines.

If you need a reminder on how to enable developer options on your device, you can refer to this tutorial: Enable developer options.


Add as preferred source in Google