1

a long time ago, i wrote a udev rule for adb with my phone (device) by setting a group. Everything was OK until some things changed recently:

  1. device rom
  2. udev packet
  3. adb packet

now i get under user:

$ adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
error: insufficient permissions for device: verify udev rules.
See [http://developer.android.com/tools/device.html] for more information.

$ adb devices -l
List of devices attached xxxxxxx no permissions (verify udev rules); see 
[http://developer.android.com/tools/device.html] usb:2-1

$ lsusb
// here we have the mentioned device
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

// udev rules newly added after i received an error (did'd change anything - still error i can open adb only using root)  
SUBSYSTEM=="usb", ATTR{idVendor}=="1d6b", MODE="0666", GROUP="adbusers"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", GROUP="adbusers"

// this rule was added very long time ago was working perfect till now 
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", GROUP="adbusers"

listed now as Bus 002 Device 007: ID 18d1:4ee7 Google Inc. 

// user is in adbuser group

PS. i did check a permission on device and I get:

 $ ls -l /dev/bus/usb/002/001
 crw-rw-r-- 1 root root 189, 128 kwi 22 13:26 /dev/bus/usb/002/001

udev rules are not applied ?

ps2. 1) enabled udev deug 2) modified rules + added symlinks to track changes by udev

SUBSYSTEM=="usb", ATTR{idVendor}=="1d6b", MODE="0666", GROUP="adbusers", SYMLINK+="android%n"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666", GROUP="adbusers", SYMLINK+="x-android%n"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", GROUP="adbusers", SYMLINK+="s-android%n"

after device plug

Apr 22 18:50:04 et27 systemd-udevd[304]: seq 2437 queued, 'add' 'usb'
Apr 22 18:50:04 et27 systemd-udevd[304]: Validate module index
Apr 22 18:50:04 et27 systemd-udevd[304]: Check if link configuration needs reloading.
Apr 22 18:50:04 et27 systemd-udevd[304]: seq 2437 forked new worker [1143]
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2437 running
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:13
Apr 22 18:50:04 et27 systemd-udevd[304]: seq 2438 queued, 'add' 'usb'
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:13
Apr 22 18:50:04 et27 systemd-udevd[1143]: MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
Apr 22 18:50:04 et27 systemd-udevd[1143]: GROUP 1008 /etc/udev/rules.d/51-android.rules:4
Apr 22 18:50:04 et27 systemd-udevd[1143]: MODE 0666 /etc/udev/rules.d/51-android.rules:4
Apr 22 18:50:04 et27 systemd-udevd[1143]: LINK 's-android1' /etc/udev/rules.d/51-android.rules:4
Apr 22 18:50:04 et27 systemd-udevd[1143]: RUN '/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}' /etc/udev/rules.d/60-vboxdrv.rules:5
Apr 22 18:50:04 et27 systemd-udevd[1143]: PROGRAM 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5' /lib/udev/rules.d/69-libmtp.rules:2283
Apr 22 18:50:04 et27 systemd-udevd[1144]: starting 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5'
Apr 22 18:50:04 et27 systemd-udevd[1144]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5': No such file or directory
Apr 22 18:50:04 et27 systemd-udevd[1143]: Process 'mtp-probe /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1 2 5' failed with exit code 2.
Apr 22 18:50:04 et27 systemd-udevd[1143]: handling device node '/dev/bus/usb/002/005', devnum=c189:132, mode=0666, uid=0, gid=1008
Apr 22 18:50:04 et27 systemd-udevd[1143]: set permissions /dev/bus/usb/002/005, 020666, uid=0, gid=1008
Apr 22 18:50:04 et27 systemd-udevd[1143]: creating symlink '/dev/char/189:132' to '../bus/usb/002/005'
Apr 22 18:50:04 et27 systemd-udevd[1143]: creating link '/dev/s-android1' to '/dev/bus/usb/002/005'
Apr 22 18:50:04 et27 systemd-udevd[1143]: creating symlink '/dev/s-android1' to 'bus/usb/002/005'
Apr 22 18:50:04 et27 systemd-udevd[1143]: created db file '/run/udev/data/c189:132' for '/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1'
Apr 22 18:50:04 et27 systemd-udevd[1145]: starting '/usr/lib/virtualbox/VBoxCreateUSBNode.sh 189 132 00'
Apr 22 18:50:04 et27 systemd-udevd[1143]: Process '/usr/lib/virtualbox/VBoxCreateUSBNode.sh 189 132 00' succeeded.
Apr 22 18:50:04 et27 systemd-udevd[1143]: passed device to netlink monitor 0x562b37096e00
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2437 processed
Apr 22 18:50:04 et27 systemd-udevd[304]: passed 308 byte device to netlink monitor 0x562b37076610
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2438 running
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:15
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
Apr 22 18:50:04 et27 systemd-udevd[1143]: unable to access usb_interface device of '/sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1/2-1:1.0'
Apr 22 18:50:04 et27 systemd-udevd[1143]: IMPORT builtin 'usb_id' returned non-zero
Apr 22 18:50:04 et27 systemd-udevd[1143]: RUN 'kmod load $env{MODALIAS}' /lib/udev/rules.d/80-drivers.rules:5
Apr 22 18:50:04 et27 systemd-udevd[1143]: created db file '/run/udev/data/+usb:2-1:1.0' for '/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/usb2/2-1/2-1:1.0'
Apr 22 18:50:04 et27 systemd-udevd[1143]: Execute 'load' 'usb:v18D1p4EE7d0232dc00dsc00dp00icFFisc42ip01in00'
Apr 22 18:50:04 et27 systemd-udevd[1143]: No module matches 'usb:v18D1p4EE7d0232dc00dsc00dp00icFFisc42ip01in00'
Apr 22 18:50:04 et27 systemd-udevd[1143]: passed device to netlink monitor 0x562b37096e00
Apr 22 18:50:04 et27 systemd-udevd[1143]: seq 2438 processed
Apr 22 18:50:04 et27 systemd-udevd[304]: cleanup idle workers
Apr 22 18:50:04 et27 systemd-udevd[1143]: Unload module index
Apr 22 18:50:04 et27 systemd-udevd[1143]: Unloaded link configuration context.
Apr 22 18:50:04 et27 systemd-udevd[304]: worker [1143] exited

The group is not applied on device I get

$ ls -al /dev/android1
lrwxrwxrwx 1 root root 15 kwi 22 18:42 /dev/android1 -> bus/usb/001/001
$ ls -al /dev/s-android1
lrwxrwxrwx 1 root root 15 kwi 22 18:50 /dev/s-android1 -> bus/usb/002/005

could be an issue on string instead numeric group values ? or GROUP="" instead GROUP:="" ? if so why udev not yields on this ?

  1. notation no as symlink works with old notation so ...
  2. string instead numeric no as its resolved proper in logs to -> 1008

ok permission is set as expected - as symlinks not showing permissions

$ ls -al /dev/bus/usb/002/001 
crw-rw-rw- 1 root adbusers 189, 128 kwi 22 19:04 /dev/bus/usb/002/001

but still I get insufficient

  • Please post your answer as an answer. And, ideally, please do use capitals at least fro the pronoun I and at the beginning of sentences. – terdon Apr 24 '17 at 10:24
2

I had the same problem, (user was member of the plugdev group) my missing piece was:

I had to enable USB for data exchange on the device after plugged in (using Android 7.1.2)

2

ok found what was issue:

file ~/android contains some files probably store debug keys which are different after device flash/wipe - simply remove them

to be exactly:

~/.android/adbkey
0

Best solution and what worked better for me is to install adb from ubuntu package. This gives you a community-maintained default set of udev rules for all Android devices.

example: sudo apt-get install adb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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