“adb devices” shows “??????? no permissions”

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

Advertisements

17 Comments

  1. What should be the active directory(pwd) to execute step no. 8 ?

    @ Nikesh : if we try to put sudo before “adb” it gives “No such command” error

    Reply

  2. Vaibhav: To execute step 8 you need not be in a particular directory. Just connect your android device and execute the command.

    The Bus and the Device number can be found by step 3.

    Reply

  3. trying to make adb owned by root, failed for me- user worked.
    FYI: copy/paste fails on this post due to font or missprint
    manually type commands to fix. look for run together dashes “–“

    Reply

  4. After i have done what you asked in the article. It still is not showing the same error when i run adb devices command.
    Any idea what might have went wrong?

    Reply

  5. great steps.
    in my scenario, i am stuck at the attribute walk, it says unknown device.
    i have set the device properties as developer and enabled usb debugging.

    lsusb shows the bus/device as 001/008 or 001/010 when i switch between 2 usb ports.

    i have ubuntu in a VMWare virtual machine on a Windows8.1 main OS that is installed as a bootcamp on a MacOS.

    It all started when WindowsOS received an upgrade several months ago and that required VMWare to be reinstalled, and i lost ability to connect to android devices then on.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s