Search code examples
android-sdk-tools

ADB recognize android without root access


Why does the following list my Android device:

sudo /opt/adt-bundle-linux/sdk/platform-tools/adb start-server
/opt/adt-bundle-linux/sdk/platform-tools/adb devices
sudo /opt/adt-bundle-linux/sdk/platform-tools/adb kill-server

List of devices attached
SH176T501818    device

but the following doesn't list my Android device?:

/opt/adt-bundle-linux/sdk/platform-tools/adb start-server
/opt/adt-bundle-linux/sdk/platform-tools/adb devices
/opt/adt-bundle-linux/sdk/platform-tools/adb kill-server

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

I shouldn't need to run adb as root, should I? What am I missing here?

$ ls -l /etc/udev/rules.d/51-android.rules
-rw-r--r-- 1 root root 67 Dec 24 20:36 /etc/udev/rules.d/51-android.rules
$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="dev"

UPDATE: On system boot, CentOS 5.8 mentions something about unknown attribute ATTR{idVendor} briefly before the boot completes.


Solution

  • Here is the .rules file in use on my system:

    https://raw.github.com/M0Rf30/android-udev-rules/master/51-android.rules

    If CentOS also complains about it's syntax, then maybe the .rules file isn't the problem. I'm not sure why your's doesn't work. Perhaps you can't leave the ATTR{idProduct} out?