How To Install and Use Android Debug Bridge (adb) in Linux

Android Debug Bridge (adb) is the most used command-line tool that enables the communication between a personal computer and a connected Android-powered device or emulator instance over a USB cable or TCP/IP (wirelessly).

It supports various device actions such as networking, scripting, installing and debugging apps, and file transfer. It also provides access to a Unix shell that can be used to run a variety of Linux commands on a device.

adb is a client-server tool that includes three main components:

  • a client that runs on your development machine and sends commands. You can execute it from a command line by running an adb command.
  • a daemon (adbd) that runs as a background process on each device and executes commands on a device.
  • a server that manages communication between the client and the daemon, it runs as a background process on your development machine.

The adb command-line tool ships with the standalone Android SDK Platform Tools package, a component of the Android SDK. Let’s look at how to grab and install the latest version of the Android SDK Platform Tools package in Linux.

Install Android Debug Bridge (adb) in Linux

To install the adb package, run the appropriate command for your Linux distributions, as follows:

$ sudo apt install adb         [On Debian, Ubuntu and Mint]
$ sudo yum install adb         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
$ sudo emerge -a dev-util/android-tools  [On Gentoo Linux]
$ sudo apk add adb            [On Alpine Linux]
$ sudo pacman -S android-tools            [On Arch Linux]
$ sudo zypper install adb      [On OpenSUSE]    

Note: If you wish to use the latest version of adb, move to the next section to download and set up the latest binary from the Android SDK Platform Tools package release.

Install Android SDK Platform Tools in Linux

You can download the most recent version of the Android SDK Platform command-line tools from the SDK Platform Tools release page. Alternatively, run the following commands to download the archived package, extract it, and move it into the extracted folder:

$ mkdir cli-tools
$ wget -c https://dl.google.com/android/repository/platform-tools-latest-linux.zip
$ unzip platform-tools-latest-linux.zip 
$ cd platform-tools/
Download SDK Platform Tools in Linux
Download SDK Platform Tools in Linux

After extracting the archive file, you can list the content of the extracted folder and the adb command should be in there as shown in the following screenshot:

$ ls
Confirm adb Command
Confirm adb Command

To check the version of the adb command-line tool you have just installed, run the following command:

$ ./adb version

Android Debug Bridge version 1.0.41
Version 34.0.1-9680074
Installed as /home/tecmint/Downloads/platform-tools/adb

How to Use Android Debug Bridge (adb) in Linux

In the following examples, we will run the latest version of the adb command installed using the instructions in the previous section.

Once you have adb installed on your Linux system, connect your device to the computer via a USB cable and enable USB debugging in the device system settings, under Developer options.

Next, run the following commands to list the devices connect to the computer, make sure to check on the devices for any prompts to allow access.

$ ./adb devices
List Connected Android Devices
List Connected Android Devices

From the output of the previous command, the string RZ8NA0V3HEY is created by adb to uniquely identify the device by its port number. The next column shows the device meaning the device is connected to the adb server. Other possible values are offline (device not connected or is not responding) and no device (means no device is connected).

To show more information about the device (device description for example product:a71naxx model:SM_A715F device:a71 transport_id:1), add the -l flag.

This is useful if many devices are attached to the computer:

$ ./adb devices -l
List Android Device Info
List Android Device Info

To install an Android app using adb, use the install sub-command as follows. If you are installing a test app, remember to add the -t flag:

$ ./adb install ~/MusiX.apk
OR
$ ./adb install -t /path/to/testapp.apk
Install Android App Using adb Command
Install Android App Using adb Command

If you have multiple devices connected to the computer, use the -s option to specify the device’s serial number:

$ ./adb -s RZ8NA0V3HEY install ~/MusiX.apk

In case your connection to a device is lost, you can reset your adb host and start over from the beginning:

$ adb kill-server

To view all available command-line options, issue the following command:

$./adb --help

That’s it for now! For more information, check out the online adb documentation, which contains more use cases and command-line examples.

Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

4 thoughts on “How To Install and Use Android Debug Bridge (adb) in Linux”

  1. Hi,

    The correct command to install adb (Android Debug Bridge) in Arch Linux is:

    $ sudo pacman -S android-tools 
    or 
    $ yay -S android-tools
    
    Reply
  2. Hi,

    I can’t find adb package in Arch Linux.

    # yay -S adb 
     -> Could not find all the required packages:
    	adb (Target)
    

    Thanks in advance.

    Reply
    • Why are you trying to find ‘adb‘ in Arch Linux?

      You must first resolve a much bigger problem:

      The glaring error in your command syntax means you must:

      Confirm the computer is powered and on? Plugged into a power supply?
      Stop using Arch Linux?
      Consider perhaps actually reading the tutorial, from the beginning that is.

      yay -S android-tools
      
      Reply

Leave a Reply to jim Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.