Environment: Ubuntu 10.04
adb 1.0.26
Problem:
$adb devices
??????????? no permissions
This is because the udev is unable to determine the permissions for this USB device.
The udev is the program that the OS uses to dynamically control the devices. As soon as a device is plugged into, udev detects it and creates device files on-the-fly.
The android debug bridge (adb) is a the daemon program that allows you to talk to device. It uses network sockets.
The “no permissions” error is because the daemon is unable to determine the right permissions to access the device as the user that it is running as. Unless the phone device appears in the udev infrastructure with correct permissions to be accessed as the user you are logged in as, it won’t work.
The solution:
1. Plug your android phone to your system.
2. Verify that you can see your phone by using “lsusb”
e.g
===================================
$ lsusb
lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 003: ID 0461:4d22 Primax Electronics, Ltd
Bus 006 Device 002: ID 413c:2106 Dell Computer Corp.
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 010: ID XXXX:YYYY Samsung Electronics Co., Ltd
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The line
Bus 002 Device 010: ID XXXX:YYYY Samsung Electronics Co., Ltd
is our phone, rest of the lines can be ignored…
3. The ID XXXX is the Vendor ID of my phone and YYYY is its Device ID. 002 is the BUS number and 010 is the Device number.
Note: These numbers may be different for your phone. So do not panic.
4. Now, type the following command in terminal
$ udevadm info –attribute-walk –name=/dev/bus/usb/002/010
Note: This will provide a lot of output as this command walks up the usb bus. If you have not connected any other device after you connected your phone, it is likely that the first entry would be of your device.
Typical output will be like thilooking at device ‘/devices/pci0000:00/0000:00:1d.7/usb2/2-5’:
KERNEL==”2-5″
SUBSYSTEM==”usb”
DRIVER==”usb”
|
|
|
|
|
|
|
|
ATTR{manufacturer}==”<Your_Phone’s_Manufacturer”
ATTR{product}==”Your_Phone’s_Product_Name”
ATTR{serial}==”Serial_Number”
The serial number here will appear when this all works.
5. Now, lets set udev rules.
Go to /etc/udev/rules.d/ directory and create a new file with name 99-android.rules
Note: In order to perform this activity, you need to be root or use sudo.
6. edit the file you created in step 5 with the following content:
SUBSYSTEM==”usb”, SYSFS{idVendor}==”XXXX”, OWNER=”yourUserName” GROUP=”yourGroupName”, MODE=”666″
7: Save and close it.
8: Reconnect the device and check the permissions…
$ ls -l /dev/bus/usb/bus-number/device-number
Enjoy
Feel free to comment if you find anything that is not working. I will try to help you