[Android General] XeoNoX:
[GUIDE] [LINUX] Installing ADB and Fastboot on Linux & Device Detection "Drivers"

Installing ADB and Fastboot on Linux & ADB Drivers Tutorial

For Debian-based distributions (Debian Ubuntu Mint etc.)

Installing ADB CLI tool ( Android Debug Bridge Command Line Interface Tool )

Installing ADB Drivers / Android Device Detection

- Accurate as of June 03, 2019​

Reason for updated guide : Obsolete tutorials everywhere and info scattered, some are just for adb and others just for the drivers.

Before you begin be sure that you have set your Android Device

to enable USB Debugging. The steps are different for

every device. Google how to turn it on your specific device.

Google "Enable USB Debugging <device model>"

Once you have enabled USB Debugging you can follow the instructions below:

NOTE: the following APT-GET has been superseded by APT. Some Linux distributions will allow the usage of both still.

Also keep in mind your Linux repositories must be up to date for the following commands to work, if you get a repository or file not found message you will probably need to fix your repos to allow the downloading of FOSS (called universe in some distros) as well as allow distro Updates. Debian and Ubuntu users can refer to this for a quick reference for their proper repos https://debgen.simplylinux.ch/

Open "TERMINAL" and do the follow:

Installs android tools and fastboot:

sudo apt-get update

sudo apt-get install android-tools-adb android-tools-fastboot

The following commands may give you some messages about the packages not being installed because you have a newer version or the dependencies are no longer need. this is OK just ignore the message and continue to the next command, i left in the commands for those running legacy systems.

Installs 32 Bit Compatibility libraries for 64-Bit Systems

sudo apt-get install ia32-libs

Packages needed for Ubuntu 13+ Updated 32-Bit Libraries

sudo dpkg --add-architecture i386

sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

By now you Linux installation already has ADB and Drivers install

but now you need to configure it to detect the Various different types

of Hardware Vendor ID's. So do the following:

Create or Open the rules for 51-android.rules

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

If this is the first time you have added any udev rules the file will

be empty as gedit will have just created it for you. Go ahead and add

in the following. If you already had 51-android.rules it will open it.

With 51-android.rules open just insert the following Vendor ID's"

for your linux distro to be able to detect the device in adb

# udev rule to detect android devices
# These rules refer to http://developer.android.com/tools/device.html

# Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev"
# Archos
SUBSYSTEM=="usb", ATTR{idVendor}=="0e79", MODE="0666", GROUP="plugdev"
# Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
# Azpen Onda
SUBSYSTEM=="usb", ATTR{idVendor}=="1f3a", MODE="0666", GROUP="plugdev"
# BQ
SUBSYSTEM=="usb", ATTR{idVendor}=="2a47", MODE="0666", GROUP="plugdev"
# Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev"
# Fairphone
SUBSYSTEM=="usb", ATTR{idVendor}=="2ae5", MODE="0666", GROUP="plugdev"
# Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev"
# Fujitsu Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev"
# Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0666", GROUP="plugdev"
# Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
# Haier
SUBSYSTEM=="usb", ATTR{idVendor}=="201e", MODE="0666", GROUP="plugdev"
# Hisense
SUBSYSTEM=="usb", ATTR{idVendor}=="109b", MODE="0666", GROUP="plugdev"
# HTC, Wiko
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
# Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev"
# Intel
SUBSYSTEM=="usb", ATTR{idVendor}=="8087", MODE="0666", GROUP="plugdev"
# K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666", GROUP="plugdev"
# KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666", GROUP="plugdev"
# Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666", GROUP="plugdev"
# Lab126
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0666", GROUP="plugdev"
# Lenovo
SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0666", GROUP="plugdev"
# LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"
# Meizu
SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", MODE="0666", GROUP="plugdev"
# Micromax
SUBSYSTEM=="usb", ATTR{idVendor}=="1ebf", MODE="0666", GROUP="plugdev"
# Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"
# MTK
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0666", GROUP="plugdev"
# NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666", GROUP="plugdev"
# Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666", GROUP="plugdev"
# Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666", GROUP="plugdev"
# OnePlus Two (unknown vendor's name)
SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev"
# Oppo
SUBSYSTEM=="usb", ATTR{idVendor}=="22d9", MODE="0666", GROUP="plugdev"
# OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666", GROUP="plugdev"
# Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10a9", MODE="0666", GROUP="plugdev"
# Pegatron
SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", MODE="0666", GROUP="plugdev"
# Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666", GROUP="plugdev"
# PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666", GROUP="plugdev"
# Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
# Rockcwell Electronics
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666", GROUP="plugdev"
# SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666", GROUP="plugdev"
# Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
# Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666", GROUP="plugdev"
# Sony
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0666", GROUP="plugdev"
# Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666", GROUP="plugdev"
# Spreadtrum
SUBSYSTEM=="usb", ATTR{idVendor}=="1782", MODE="0666", GROUP="plugdev"
# T & A Mobile Phones
SUBSYSTEM=="usb", ATTR{idVendor}=="1bbb", MODE="0666", GROUP="plugdev"
# Teleepoch
SUBSYSTEM=="usb", ATTR{idVendor}=="2340", MODE="0666", GROUP="plugdev"
# Texas Instruments UsbBoot
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", MODE="0666", GROUP="plugdev"
# Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666", GROUP="plugdev"
# Wearners
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
# Wileyfox
SUBSYSTEM=="usb", ATTR{idVendor}=="2970", MODE="0666", GROUP="plugdev"
# XiaoMi
SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666", GROUP="plugdev"
# YU
SUBSYSTEM=="usb", ATTR{idVendor}=="1ebf", MODE="0666", GROUP="plugdev"
# Zebra
SUBSYSTEM=="usb", ATTR{idVendor}=="05e0", MODE="0666", GROUP="plugdev"
# ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"
# ZUK
SUBSYSTEM=="usb", ATTR{idVendor}=="2b4c", MODE="0666", GROUP="plugdev"

Save and exit when done editing.

Change the permission of this file by executing the following command as root:

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

Reload the rules by executing the following command as root:

udevadm control --reload-rules

Add in the user group "plugdev" for the rules we just created.

sudo addgroup --system plugdev

And add your username to that group.

Replace <username> with your primary username that will use ADB without the <> around it.

sudo adduser <username> plugdev

#Other examples:

#sudo adduser JohnDoe plugdev

#sudo adduser JaneDoe plugdev

#sudo adduser BillyBob plugdev

So in these examples JohnDoe,JaneDoe, and BillyBob

were added to group "plugdev" to be able to use adb

FINALLY ADB IS READY AND GOOD TO USE!

adb kill-server

adb start-server

adb devices

NOTE: I know you can add the vendor ID's with no group such as

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666" (No UserGoup) and use it as

a shortcut to bypass the user groups, however as per Google's instructions it is

reccommended to make a user group, the reason may be for extra security

and to avoid possible vulnerabilities.

NOTE: If you get the following error:

*

daemon started successfully

*

error: device unauthorized. This adb server's $ADB_VENDOR_KEYS is not set Try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device.

This means you have adb properly installed, u just have to authorize access to your android device from your android device, once you run the

"adb your-command-here"

you will IMMEDIATELY see the following popup and must choose "OK"

Authorizing must be done with EVERY new android device you connect once your run the ADB COMMAND.

keywords: linux debian ubuntu drivers driver android kindle fire tv stick firestick debugging debug samsung lg xiaomi amazon guide tutorial setup learn how to install adb usb cable detect hardware