Udev Rules for ADB in Ubuntu 11.04 “Natty Narwhal”


I’ve posted on getting udev and adb to work nicely in the past, and I figured I’d post here again for Ubuntu’s latest incarnation, version 11.04 “Natty Narwhal.”

Once I moved over to 11.04 from Arch (and previously Gentoo; I was distro-hopping for awhile but eventually ended back up with Ubuntu), I found that I was required to start ADB via sudo upon every reboot (which wasn’t often, but still a hassle). Udev should have handled this, but it did not, so the only solution was to search the web for working udev rules. It took me quite some time to find these, but now that I’ve got a working setup I figured I’d share it here so that other people do not waste time solving the same issue.

These udev rules should be placed in /etc/udev/rules.d/99-android.rules:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4"
TEST=="/var/run/ConsoleKit/database",
RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"

Remember that in the above text, ATTRS{idVendor} should equal the vendor id specific to your phone’s manufacturer. If you do not know that id, run `lsusb’ and you should get output similar to this:

Bus 001 Device 015: ID 0bb4:0fff High Tech Computer Corp.
Bus 001 Device 011: ID 0bb4:0c91 High Tech Computer Corp.

The vendor id is the first 4 characters of the ID string. In my case, it was 0bb4.

After updating the udev rules, restart the udev daemon by running the following command:

sudo service udev restart

Now restart adb and you should find that it displays your connected devices properly.

4 Comments

Misael Loyola

May 5th, 2011
at 11:38pm

i sugest you do this..

SUBSYSTEM==”usb”, ATTRS{idVendor}==”22b8:2d66″, SYMLINK+=”android_adb”, MODE=”0666″ GROUP=”plugdev”
TEST==”/var/run/ConsoleKit/database”,
RUN+=”udev-acl –action=$env{action} –device=$env{DEVNAME}”

run lsusb and put the 8 digits, “####:####” took me time to figure it out but finally got it to show my device :)

[...] entirely sure if 99 or 51 is the correct name for the file (the Android Dev documents says 51, this tutorial says 99) so to ensure that it works I’m going to create both. Type ‘ sudo touch [...]

You save my day.

Thank you.

Thank you. This is the 100th comment I found on udev rules for Android devices and the only one that finally worked.

Leave a Comment