3

I have installed the android SDK but I’m getting an error when using a hardware device, executing “./adb device$ I get this error:

List of devices attached 
????????????    no permissions

While if I execute “sudo ./adb device” there is no error:

List of devices attached 
HT019P80XXX device

Adb must work for all users (also when eclipse starts it) but It only works as root. The permissions of the related files are:

-rwxr-xr-x 1 root root 72 2012-03-20 09:53 /etc/udev/rules.d/51-android.rules
-rwxr-xr-x 1 ariadna ariadna 159620 2012-03-19 13:45 adb

I have googled and tried different solutions but none off then works on my Ubuntu, any idea?

Thank you

2
  • where you saved android SDK folder? Commented Mar 20, 2012 at 9:54
  • The path is /home/userFolder/SW/android-sdk-linux/platform-tools, could be related?
    – Hera
    Commented Mar 20, 2012 at 13:34

4 Answers 4

6

I get it working by using this rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", OWNER="kman",
GROUP="kman"
1
  • 1
    Makes sense - the udev rule needs to match the VID (and if given, PID) of the device you are attempting to connect - these can be found via lsusb or sometimes via dmseg. 0bb4 is a VID for HTC. Commented May 1, 2012 at 20:10
2

Try finding your device and chown to your user:

In my case a Sony Ericsson:

lsusb | grep Sony

Output:

"Bus 001 Device 018: ID 0fce:6161 Sony Ericsson Mobile Communications AB"

then change the owner for that device:

sudo chown user:group /dev/bus/usb/001/018

Note 1: if you unplug the device/restart pc you will have to change owner again.

Note 2: you may need to start/restart adb server:

adb kill-server
adb start-server

P.S. I also was unable to get it working with rules for udev. I really needed this because i am using eclipse that restarts adb without sudo.

0

in the file 51-android.rules add to each row of "owner"

SUBSYSTEM==”usb”, ATTRS{idVendor}==”0123″, SYMLINK+=”android_adb”, MODE=”0666″, OWNER=”your_user_name”

Then restart udev and adb

4
  • thank you but I does not work in my case, I have the same error introducing SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4",SYMLINK+=”android_adb”, MODE=”0666″, OWNER=”ariadna, then I execute sudo service udev restart and ./adb devices (not as root). any other idea?
    – Hera
    Commented Mar 20, 2012 at 9:38
  • if you try switching OWNER with USER?
    – Blackbelt
    Commented Mar 20, 2012 at 9:49
  • doing that works but I should not need root privilege to execute properly
    – Hera
    Commented Mar 20, 2012 at 10:03
  • sorry, but I don't see other solutions. Commented Mar 20, 2012 at 10:12
0

Try editing the appropriate udev line (assuming your device is an HTC) as follows:

SUBSYSTEM==”usb”, ATTRS{idVendor}==”0bb4″, MODE=”0666″ GROUP="plugdev"

Then make sure you are in the group 'plugdev'.

BTW You are completely correct - you should absolutely not need to be root to start the adb server. Otherwise, to set up a multi-user environment with multiple android developers, you would need to give all developers root privileges or start the adb server during boot as root, neither of which are very sensible. If it is not possible on your system then it is a bug in udev.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.