Install Android ADB on Ubuntu Linux

To install Android ADB (Android Debug Bridge) on Ubuntu, you can follow these steps:

Identify the Vendor ID:

Connect your Android device to your computer and run the following command to identify the vendor ID:

lsusb

Look for the line that corresponds to your Android device. The vendor ID is the first part of the ID after ID, for example, 18d1 for Google.

Update Your Package List: Open your terminal and update the package list to ensure you have the latest information on the newest versions of packages and their dependencies.

sudo apt update

Install ADB: You can install the ADB package using the following command:

sudo apt install android-tools-adb

Verify Installation: After installation, you can verify that ADB is installed correctly by checking its version:

adb version

Add Your User to the Plugdev Group (Optional): This step ensures that you can use ADB without root permissions. It’s especially useful when working with devices.

sudo usermod -aG plugdev $USER

Then, log out and log back in to apply the changes.

Set Up Udev Rules (Optional): To communicate with your Android device over USB, you might need to set up udev rules. Create a new udev rules file:

sudo nano /etc/udev/rules.d/51-android.rules

Add the following line to the file, replacing xxxx with your device’s USB vendor ID (you can find a list of these IDs online or in the documentation for your device):

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"

Save and close the file, then reload the udev rules:

sudo udevadm control --reload-rules

Now, you should have ADB installed and configured on your Ubuntu system. You can connect your Android device and start using ADB commands.

Install Android ADB on Fedora Linux

sudo dnf install android-tools

Create a plugdev group (if it doesn’t already exist) and add the user to it:

sudo groupadd plugdev
sudo usermod -aG plugdev $LOGNAME

Log out and log back in for the group change to take effect. Use the id command to verify that you are in the plugdev group:

id

Identify the Vendor ID:

Connect your Android device to your computer and run the following command to identify the vendor ID:

lsusb

Look for the line that corresponds to your Android device. The vendor ID is the first part of the ID after ID, for example, 18d1 for Google.

Create a udev Rule:

Create a file for the udev rule:

sudo nano /etc/udev/rules.d/51-android.rules

Add the Following Content:

In the file, add a rule to grant the necessary permissions. Replace YOUR-VENDOR-ID with your device’s vendor ID. Here’s an example rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="YOUR-VENDOR-ID", MODE="0666", GROUP="plugdev"

For example, if the vendor ID is 18d1 (Google):

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"

Change File Permissions:

Change the permissions of the file to make it readable:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

Reload udev rules:

sudo udevadm control --reload-rules
sudo udevadm trigger

Restart your machine.

Check ADB Devices:

Verify that your device is recognized correctly:

adb devices

References
https://developer.android.com/studio/run/device