How to install ADB and fastboot on Ubuntu

ADB is a powerful command-line tool that provides access to a Unix shell, letting you communicate with your Android device from a client machine. Using ADB, you can install apps, copy files, run shell commands, and debug apps, among other things right from your computer without touching the actual device.

Fastboot is the name of three different things: a protocol, a bootloader mode and a program that runs on the computer, all of which let you communicate with your Android device. Usually, fastboot is used to re-flash the system partitions inside the Android device.

Before getting any further, we assume that you have a basic understanding of how the Linux shell works and how we send commands to it. You also need to know how to run terminal commands under root privileges in the safe way using sudo.

In this article, we will show you to install adb and fastboot on Ubuntu 20.04 (codename Focal Fossa). The installation instructions is applicable to any Linux distro based on Ubuntu or Debian, such as Linux Mint, ElementaryOS or Pop! OS.

Install ADB and Fastboot on Ubuntu

First, you have to make sure that all your system packages are up-to-date by running the two following commands in the terminal.

sudo apt update sudo apt upgrade
Code language: Shell Session (shell)

Now that the system is updated with the latest packages, we will now proceed to install ADB and fastboot by sequentially run the following commands:

sudo apt install android-tools-adb android-tools-fastboot -y
Code language: Shell Session (shell)

Once the installation has completed, you can check adb version number to be sure that the system recognizes the program by running adb version. The output may look like this :

Android Debug Bridge version 1.0.36 Revision 1:7.0.0+r33-2
Code language: CSS (css)

After installation, the ADB server will register itself to system daemon list and start on its own every time the system boots up. If it doesn’t, you can do that manually by running

sudo adb start-server
Code language: Shell Session (shell)

Alternatively, listing connected devices using adb devices also trigger ADB server to start if it’s not already running

$ adb devices List of devices attached daemon not running. starting it now on port 5037 * daemon started successfully *
Code language: Shell Session (shell)

To stop the ADB server, use

sudo adb kill-server

Enable adb debugging on Android devices

Before you can actually use ADB to connect to any Android device, you have to enable USB debugging on the device itself.

The steps to do that on each device is different, but basically you can follow the instructions below.

First, access device Settings app, then go to the Developer Options (Some devices require that you tap several times on Android Version in the About Phone section in order to show the hidden Developer Options).

Once that’s enabled, you can connect the Android device to the PC and run the following command to list out connected devices :

sudo adb devices

On a few devices, you may see a pop up asking for user permission for the PC to access Android filesystem. However, if you get any error regarding permission, then restart ADB or the whole PC and try again. For additional help or useful information, we recommend you check the official Android website or Android Debug Bridge (adb) documentation page.

We hope that the information above is useful to you. If you’re interested in advanced source editing in Visual Studio Code, check out our post on how to enable/disable word wrap in VSCodeHow to use LaTeX in VSCode or how to automatically indent your code in Visual Studio Code.

Click to rate this post!
[Total: 1 Average: 5]

Leave a Comment