Android, adb and “no permission”

I’ve got tired of seeing:

$ adb devicesList of devices attached 
???????????? no permissions

So I had to dig a bit. Combining StackOverflow article and official docs I arrived at somewhat simple solution that avoids overly enthusiastic suggestion of making device “anybody-writable” and made things “just right” for myself (fixing old-school Udev rules sytax along the way):

  1. plug-in your device and using lsusb locate attributes like iVendor and iProduct (I just went with iVendor…)
  2. add /etc/udev/rules.d/51-android.rules :
    SUBSYSTEM=="usb",ATTR{idVendor}=="18d1",MODE="0660",GROUP="users"
  3. restart udev:
    udevadm control --reload-rules

End result: my any of my Nexus7 devices whenever attached will be owned by users group (which includes me and my family) with adb now properly responding:

$ adb devices
List of devices attached 
07bdc25b        unauthorized

which only means I have tap OK on N7 upon connect to allow adb debugging from this PC.

Neat trick I’ve spotted is that you can poke some of the rules without re-plug via:

udevadm trigger --attr-match=vendor='Yoyodyne' --attr-match=model='Frobnicator 300'

Didn’t have to use it this time – but may come handy next time.

Leave a Reply

Your email address will not be published. Required fields are marked *