How to install and setup ADB tools on Linux

ADB (Android Debug Bridge) has a vast amount of capabilities. We are going to feature a concise list of the most useful features ADB provides us and also guide to installing it on your Linux PC.

If you have an Android phone, you probably want to create backups relatively quickly and reliably. Chances are you have unnecessary built-in Google apps or apps from your manufacturer that you want to get rid of. This is not allowed by default, obviously, but there is a solution.

Its a rather elegant one, because it involves no third party programs, that could be potentially malicious, but a part of the open-source Android SDK (Software Development Kit). The utility we are going to use is ADB.

ADB features and how to install

ADB (Android Debug Bridge) has a vast amount of capabilities. We are going to feature a concise list of the most useful features ADB provides us.

Transferring files

Files can be transferred from the phone, or to the phone using ADB. It uses the utilities of ‘push‘ and ‘pull‘ to achieve the mentioned task.

You can even sync an already copied directory, that may have been modified.

Uninstalling app/services

ADB can be used to uninstall any app on your phone. Yes, you can get rid of those pre-installed apps that you never found a use for, and which only ended up making your phone messier.

Installing apps

APK files can be installed across the phone very quickly if you have it on your system. Just a simple code, no prolonged processes or prompts, and that app will be installed.

Check logs

The phone’s logs in real-time can be accessed using a straightforward command.


Backups can be created via ADB, and in fact, it has several useful options for that. These are the things that the yes/no options are provided for:

  • storing APK files of apps installed
  • storing OBB (saved) data of apps installed
  • storing the content of the device’s SD card

The restoring options are also available.

How to install

Installing ADB is quite simple. For Ubuntu/Debian and its derivatives, use the following command:

sudo apt-get install android-tools-adb

Or if it doesn’t work,

sudo apt-get install adb

ADB installing
ADB installing

On Fedora, use:

sudo dnf install adb


Now, we’ll show an essential guide to setting up your phone for using ADB. First of all, enable ‘USB Debugging‘ from the Developer Options in the settings. Go back to your system, and enter this command:

adb start-server

ADB starting
ADB starting

Now connect your phone to your system with a data cable. You will get a prompt asking whether or not do you want to allow USB debugging. Check ‘Always allow from this computer‘ and tap ‘OK.’

Now you can deploy commands.

Optional: Wireless connection

To connect to your phone wirelessly, make sure that your phone and computer system are connected to the same network. For now, connect your phone to your computer system through a data cable, with ‘USB Debugging‘ enabled in the Developer Options of your phone’s settings.

You will get a prompt on your phone whether to trust the computer it has been connected to, to which you need to answer with the positive remark.

Go to your phone’s settings, and navigate to ‘About Phone.’ Move to the ‘Status‘ menu. There will be a slot denoting the IP address of your phone. Make a note of it.

IP Address on phone
IP Address on phone

After completing the steps above, enter:

adb tcpip 5555

This enables connecting to your phone through the 5555 port.

You can now unplug your device. To connect to your phone wirelessly now, enter the command in the following format:

adb connect <IP ADDR OF PHONE>:5555

Enabling wireless connection
Enabling wireless connection

Now you are ready to deploy commands.


Transferring files

The files that you see on your phone’s file manager (Internal storage) are situated in the directory /storage/sdcard0. The data on your external SD card is on /storage/sdcard1. Now to transfer any data to and from the system, use the following commands:

Command to get a file from phone, taking an example of a file named ‘test‘ in the Download folder:

adb pull /storage/sdcard0/Download/test

From this syntax, you can understand how to get into more in-depth directories. Similarly, you can replace sdcard0 with sdcard1 if it is in your external storage.

Now an example for sending files:

To send data to your phone’s system from your computer’s Downloads directory to the Document folder of your phone:

adb push Downloads/test /storage/sdcard0/Document

Configure the basic syntax as you desire.

ADB transferring files
ADB transferring files

Installing/Uninstalling apps

To install an APK file to your phone, make sure APK is in the home directory, and use this simple syntax:

adb install <apk_file_name>

ADB installing
ADB installing

To uninstall, you first need to list all the programs on your phone. To do that, execute the following command:

adb shell pm list packages

ADB packages list
ADB packages list

Names are pretty complicated, so finding the app you want to remove might prove a little tricky, but the name usually stays the same. So try and find it, and when you’re sure that it is correct, execute the following command to uninstall:

adb uninstall --user 0 <app_name>

ADB uninstalling
ADB uninstalling


To get the logs in real-time, execute this command:

adb logcat

The logs are pretty complex to understand and get a hold of, but we mentioned it nevertheless, for users who would require it.

ADB logs
ADB logs

Creating backups

Creating backups has several options, as mentioned earlier. The general syntax is:

adb backup -f file [options]

Here, the file is the file where the backup will be stored. Other options available can be used this way:

  • Storing APKs
    • Backing up APKs: -apk
    • Not backing up APKs: -noapk
  • Storing application OBB data
    • Storing: -obb
    • Not storing: -noobb
  • Storing data of external storage:
    • Storing data: -shared
    • Not storing: -noshared
  • Backing up all data: -all
  • Whether to or not store APKs of system apps:
    • Storing: -system
    • Not storing: -nosystem

Sample command for backup (storing APKs, storing external storage, not backing up system apps), which will be saved as bckp in the home directory:

adb backup -f bckp -apk -shared -nosystem

Restoring backups

Restoring backups is pretty easy using ADB. This can be accomplished using:

adb restore <backup filename>


ADB is a great utility to work with and provides an enormous amount of flexibility to your phone. All required utilities are made easier to access and execute, all at the comfort of your computer system, no rooting needed, and even wirelessly, if that’s what you want.

Pulkit Chandak
Pulkit Chandak is a Linux enthusiast and has been using and experimenting with open source software, and hardware too since a long time. He is a huge admirer of open source software and wants to ventilate it to all around him. He is interested in reviewing and writing tutorials on Linux and its innumerable distributions. He believes that freedom in software leads to freedom of the mind from the chains of limits.


Please enter your comment!
Please enter your name here




best video players for linux
Most Linux-based systems come with a built-in video player, but let's be honest, it most definitely won't be able to satisfy all of your requirements, due to the fact that default software is mostly made for basic purposes. In this article, we will review the 5 Best Video Players for Linux and thoroughly discuss their features as well as their pros and cons.
foss and linux
The rise of the Linux operating system, in all its various distributions, over the past few decades has catapulted the popularity of Free or Open Source Software (FOSS). Let's guide you in understanding what is FOSS, how it differs from freeware and is Linux a FOSS.
best linux distros for windows users
When Microsoft initially released Windows 7 in October 2009, the software giant committed to providing ten years of support for its popular operating system.  The much-maligned Microsoft was true to their word, support for Windows 7 ended just yesterday a little over ten years after its release.