Platform tools adb linux

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

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:

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.

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:

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

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:

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

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

Источник

How to Install ADB and Fastboot on Linux

Android, being an open-source OS, is very customizable. You can customize it by adjusting device settings to your preference, using themes and apps, and so on. While some customizations can be achieved only after rooting your device, there are many others that can be done using ADB commands. ADB works like a bridge between Android devices and computers. However, before you can control your phone or tablet using ADB commands, you must set up ADB on your Windows, macOS, or Linux computer. In this guide, we’ll check out how we can install ADB and Fastboot on Linux.

ADB and Fastboot are multi-purpose command-line tools. By using ADB and Fastboot commands on your computer, you can get detailed information about your Android device, uninstall system apps without root, install apps, push or pull files, backup data, debug your device, enable and disable features and customize it in many ways. If you are interested in exploring the geeky aspect of owning an Android device, let’s start with installing ADB and Fastboot on Linux first.

Installing ADB and Fastboot on Linux

  1. Open the Settings app on your Android device and enable USB debugging via Developer settings.
  2. Download the latest Android SDK Platform-Tools for Linux.
  3. Extract the downloaded zip file to your computer’s desktop.
  4. Now, open a Terminal window. You can launch the Terminal either by pressing Ctrl + Alt + T keyboard shortcut or using an app launcher.
  5. When the Terminal window is opened, type the path to the extracted platform-tools folder in the following format: cd / path to the extracted platform-tools folder /
  6. For instance, if you extracted the zip file on your desktop, the command line would look like this. Here, cd means “change directory”.
cd /Users/Technastic/Desktop/platform-tools_r33.0.3-linux/platform-tools/
Читайте также:  Promt translation server linux
  • As soon as you press the Enter key after typing the above command, the directory path in the Terminal will change to the “platform-tools” folder that contains the ADB and Fastboot files.
  • In case you are having any issues with the above steps, open the platform-tools folder using the Nautilus file manager. Then right-click on any empty area inside the folder window and select the Open in Terminal option.Open in terminal option in Linux
  • It’s time to connect your Android phone or Tablet to your Linux system via a USB cable.
  • Make sure that you have selected the connection mode to MTP on your phone. To do so, connect your Android device to your PC, slide down the notification panel, tap on the connection mode notification and select Transferring files / Android auto as the connection mode.usb file transfer mode on android
  • Also, make sure your phone’s screen is unlocked while it’s connected to the computer and you execute the ADB command. It’ll be a good idea to extend the screen timeout duration from the Display settings.
  • To launch the ADB daemon and verify that your Android device is detected by your Linux computer, execute the following command.

    adb devices or ./adb devices
  • At this point, you’ll see a prompt asking you to authorize the ADB device on your Android device. Tap on Allow when you see the Allow USB debugging prompt.authorize adb on samsung galaxy s22
  • After you authorize ADB on your Android device, execute the adb devices command again. adb devices command in linux terminal
  • This time, ADB will detect your connected Android device and show an alphanumeric serial number in the Terminal window.
  • Installing ADB on Debian or Fedora

    As a Linux user, you must be aware that there are a number of Linux distros like Ubuntu, Fedora, CentOS, Elementary OS, Deepin OS, etc. While the steps to install ADB and Fastboot on Linux described above should work on most distros, there are some in which you need to take a little different course. For instance, on Fedora/SUSE and Debian/Ubuntu, you don’t need to download the Android SDK Platform-Tools. Instead, you can use a command in the Terminal to install ADB drivers directly.

    In case you are a Fedora/SUSE-based Linux user, you can use the following command to install ADB and Fastboot on your PC.

    sudo yum install android-tools

    Those who use a Debian/Ubuntu-based Linux distribution, execute the command line given below to set up ADB.

    sudo apt-get install android-tools-adb

    In these Linux distributions, you are supposed to add “./” before ADB commands. Thus, you have to use ./adb devices in place of adb devices .

    Adding System-wide ADB and Fastboot on Linux

    In a normal installation, you’ll be able to access ADB and Fastboot only by launching the Terminal from the platform-tools directory. However, if you give system-wide access to ADB, you’ll be able to use ADB commands by launching the Terminal anywhere. Please note that if you have a 64-bit system, you’ll have to install libstdc++ and glibc.i686 on your computer first.

    Читайте также:  Intel drivers installer linux

    In order to enable system-wide ADB on Linux, launch the Terminal and execute the following command.

    sudo gedit .bashrc

    The command will open the file in the Gedit text editor. Add the path of the platform-tools folder at the end of the file and save the changes.

    export PATH=$:/home/Technastic/Desktop/platform-tools_r33.0.3-linux/platform-tools/

    That’s it! You can now use ADB and Fastboot commands from any location on your Linux PC.

    Источник

    Platform tools adb linux

    ADB and Fastboot are very important if you want to do advanced stuff on your Android device. For an Android device to communicate properly with a computer in ADB and Fastboot mode, proper drivers must be installed on the computer.

    If you own a Linux system and want to connect your Android device in ADB or Fastboot mode to it, then this guide is for you. Read ahead to learn how to install ADB and Fastboot Driver on Linux.

    About using adb commands in Linux distros

    Install Adb And Fastboot On Linux | Guide

    Before getting started, we would like to get a small thing out of the way. Most Linux distros allow the user to issue adb commands as below:

    If it does not work for you, you should use the below format:

    Install ADB and Fastboot on Linux with Google Platform Tools

    1. Download ADB and Fastboot Driver for Linux

    There was a time when you had to download and install the whole Android SDK just to get the platform-tools aka ADB and Fastboot Drivers. Fortunately, that is not the case anymore. Google has finally made them available as a separate package for the ease of the users. You can grab the package from the below link:

    2. Install ADB and Fastboot Driver on Linux

    Make sure to unzip and extract the content of the downloaded files into an easily accessible location. We are going to make use of the built-in Terminal to get the job done.

    1. Open a Terminal instance on your Linux system.
    2. From inside the terminal, access the directory where you have extracted the contents of the downloaded zip file.

    3. Configure Android device

    1. Connect your Android device to your Linux system via USB cable. Also, make sure that your device is connected in ‘MTP File Transfer’ or ‘File Transfer’ mode.
    2. In the Terminal, execute the below command:
  • Now, on your Android device, you should get a prompt asking you to allow USB debugging permissions to the connected computer. Make sure ‘Always allow from this computer’ is checked and grant the permission.Install Adb And Fastboot On Linux | Guide
  • Re-execute the above command and you should be able to see your device listed on the Terminal.Install Adb And Fastboot On Linux | Guide
  • 4. Add ADB & Fastboot system-wide [Optional]

    export PATH=$:/home/YOUR-USERNAME/path/to/adb

    Install ADB & Fastboot on Linux via Terminal commands

    Some Linux distros allow us to directly install the ADB and Fastboot drivers instead of downloading the drivers from a third-party source. Below are the commands to install them directly via Terminal.

    Debian-based Linux Distros

    Fedora/SUSE-based Linux Distros

    sudo yum install android-tools

    Tip: You should note that Ubuntu, the most popular Linux distro, and all its derivatives are Debian based.

    Источник

    Оцените статью
    Adblock
    detector