Android Debug Bridge (adb) is probably the most used command-line instrument that allows communication between a private laptop and a linked Android-powered machine or emulator occasion over a USB cable or TCP/IP (wirelessly).
It helps varied machine actions equivalent to networking, scripting, putting in and debugging apps, and file switch. It additionally offers entry to a Unix shell that can be utilized to run a number of Linux instructions on a tool.
adb is a client-server instrument that features three fundamental parts:
- a consumer that runs in your growth machine and sends instructions. You possibly can execute it from a command line by working an adb command.
- a daemon (adbd) that runs as a background course of on every machine and executes instructions on a tool.
- a server that manages communication between the consumer and the daemon, it runs as a background course of in your growth machine.
The adb command-line instrument ships with the standalone Android SDK Platform Instruments package deal, a element of the Android SDK. Let’s take a look at easy methods to seize and set up the most recent model of the Android SDK Platform Instruments package deal in Linux.
Set up Android Debug Bridge (adb) in Linux
To put in the adb package deal, run the suitable command in your Linux distributions, as follows:
$ sudo apt set up adb [On Debian, Ubuntu and Mint] $ sudo yum set up 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 adb [On Arch Linux] $ sudo zypper set up adb [On OpenSUSE]
Notice: Should you want to use the most recent model of adb, transfer to the following part to obtain and arrange the most recent binary from the Android SDK Platform Instruments package deal launch.
Set up Android SDK Platform Instruments in Linux
You possibly can obtain the latest model of the Android SDK Platform command-line instruments from the SDK Platform Instruments launch web page. Alternatively, run the next instructions to obtain the archived package deal, extract it, and transfer 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/
After extracting the archive file, you’ll be able to checklist the content material of the extracted folder and the adb command needs to be in there as proven within the following screenshot:
$ ls
To verify the model of the adb command-line instrument you will have simply put in, run the next command:
$ ./adb model Android Debug Bridge model 1.0.41 Model 34.0.1-9680074 Put in as /residence/tecmint/Downloads/platform-tools/adb
Learn how to Use Android Debug Bridge (adb) in Linux
Within the following examples, we’ll run the most recent model of the adb command put in utilizing the directions within the earlier part.
After you have adb put in in your Linux system, join your machine to the pc by way of a USB cable and allow USB debugging within the machine system settings, below Developer choices.
Subsequent, run the next instructions to checklist the units hook up with the pc, be certain to verify on the units for any prompts to permit entry.
$ ./adb units
From the output of the earlier command, the string RZ8NA0V3HEY is created by adb to uniquely establish the machine by its port quantity. The subsequent column reveals the machine that means the machine is linked to the adb server. Different potential values are offline (machine not linked or is just not responding) and no machine (means no machine is linked).
To point out extra details about the machine (machine description for instance product:a71naxx mannequin:SM_A715F machine:a71 transport_id:1), add the -l
flag.
That is helpful if many units are hooked up to the pc:
$ ./adb units -l
To put in an Android app utilizing adb, use the set up sub-command as follows. In case you are putting in a check app, keep in mind so as to add the -t
flag:
$ ./adb set up ~/MusiX.apk OR $ ./adb set up -t /path/to/testapp.apk
You probably have a number of units linked to the pc, use the -s
choice to specify the machine’s serial quantity:
$ ./adb -s RZ8NA0V3HEY set up ~/MusiX.apk
In case your connection to a tool is misplaced, you’ll be able to reset your adb host and begin over from the start:
$ adb kill-server
To view all out there command-line choices, problem the next command:
$./adb --help
That’s it for now! For extra data, try the on-line adb documentation, which accommodates extra use instances and command-line examples.
If You Recognize What We Do Right here On TecMint, You Ought to Think about:
TecMint is the quickest rising and most trusted neighborhood web site for any sort of Linux Articles, Guides and Books on the net. Hundreds of thousands of individuals go to TecMint! to look or browse the hundreds of revealed articles out there FREELY to all.
Should you like what you’re studying, please think about shopping for us a espresso ( or 2 ) as a token of appreciation.
We’re grateful in your by no means ending help.