adb and fastboot on Ubuntu
Installation

Install adb and fastboot on Ubuntu

Sagar Sharma
Sagar Sharma

Table of Contents

For those who don't know, ADB and fastboot are components of Android SDK and are mostly used by tech geeks like us 😉.

Here, ADB reads for Android Debug Bridge, a command line utility that lets you control your Android device using your computer whereas the fastboot is used to flash your Android device.

When paired together (ADB and fastboot), they make a deadly combination and let you play with your Android device like never before.

So in this tutorial, I will walk you through the following:

  • Installation of ADB and fastboot.
  • The basic usage of ADB.

Let's start with the installation part.

How to install ADB and fastboot on Ubuntu

To install ADB and fastboot in Ubuntu, all you have to do is execute the following command:

sudo apt install adb fastboot

Once you are done with the installation, you can check the installed version of ADB using the following:

adb version

Now, let's have a look at some basic operations you can do with ADB.

How to use ADB in Ubuntu

The first step to use ADB is to enable USB debugging from your Android phone which is found in the developer options.

To get the developer options, go to About phone and tap on Build number multiple times and soon you will find the developer options in your settings menu:

enable developer options in Android

Next, go to the developer options and enable the USB debugging:

enable USB debugging in Android phone

That's it! Now, connect your Android phone to your computer and start the ADB server using the following command:

sudo adb start-server
Start the ADB server in Ubuntu

Now, your phone will ask you to allow USB debugging for the computer (if you don't see the given prompt, re-enable USB debugging while keeping the phone connected to the computer):

Allow USB debugging

To verify if the phone is connected, list down the devices using the following command:

adb devices
list connected devices in ADB ubuntu

If your device is connected properly, you'll see a similar output to the above image.

Now, let's have a look at how you can send files between two devices.

How to send files between phone and computer

To send files between two devices, first, you have to get into your Android device's shell using the following:

adb shell
Get into android device's shell using ADB

As the Android itself uses the Linux kernel, you can use all the basic commands such as here, I used the ls command to list files and directories:

List the contents of Android phone using ADB in Ubuntu

Once you find the exact directory where you want to send files, exit from this prompt:

exit

Now, you'd have to use the adb push command in the following manner to send files from your computer to your Android phone:

adb push Filename /path/to/send/file

For example, here, I've transferred Sagar.jpg to /storage/emulated/0 directory:

adb push Sagar.jpg /storage/emulated/0
Send files from Ubuntu computer to Android phone using ADB

Pretty easy. Right?

Transfer files from Android to Ubuntu

To transfer files from Android to Linux, you'd have to use the adb pull command as shown here:

adb pull /path/to/file/in/Android /target

For your reference, I will transfer Sagar.jpg from /storage/emulated/0 to my home directory:

adb pull /storage/emulated/0/Sagar.jpg .
Transfer files from Android to Ubuntu Linux using ADB

That was quick 🤯.

Wrapping Up...

This tutorial went through how you can install ADB and fastboot in your Ubuntu machine and use the ADB to transfer files between Android and Linux.

I hope this tutorial gave you an idea of how you can utilize the ADB.

Have more queries or ideas? Drop a comment.



Sagar Sharma

Sagar Sharma

A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.