While working on Ubuntu Linux, you may encounter the following error when run "adb devices" command from the terminal
To fix the problem permanently, you need to add a
udev
rules file that
contains a USB configuration for each type of device you want to use
for development. In the rules file, each device manufacturer is
identified by a unique vendor ID, as specified by the ATTR{idVendor}
property. For a list of vendor IDs, see USB
Vendor IDs.
To set up device detection on Ubuntu Linux:
Log in as root and create this file: /etc/udev/rules.d/51-android.rules
Use this format to add each vendor to the file:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
In this example, the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.
Note: The rule syntax may vary slightly depending on your environment.
Now your "51-android.rules" file may look like this..
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04c5", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04c5", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="109b", MODE="0666"
.....
....
......
Run the following commands (without the leading $):
$ sudo chmod 644 /etc/udev/rules.d/51-android.rules
$ sudo chown root. /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ sudo killall adb
Disconnect the USB cable between the phone and the computer.
Reconnect the phone.
Run adb devices to confirm that now it has permission to access the phone
You can download 51-android.rules from the Downloads tab