udev headaches on Debian testing (wheezy)

Filed under Android, Debian, Linux, Wheezy
Tagged as , , , , , , , , ,

Well, that was fun.

It only took all of 4 hours to get my phone to be recognized by adb on my new Debian testing (wheezy) system. I can thank udev for that one.

I’ve found the solution. The standard Ubuntu “/etc/udev/rules.d/51-android.rules” will not work here. Debian’s udev is slightly different.

Through chatting with some people in #debian, it was learned that changing

# usbfs-like devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
				MODE="0664"

 

in /lib/udev/rules.d/91-permissions.rules to

# usbfs-like devices
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
			MODE="0666"

 

allows adb to work. After some thought, this led me to realize that 51-android.rules is parsed before 91-permissions.rules. Therefore, that rule in 91-permissions.rules is parsed after 51-android.rules.

So, first off, we need to use /etc/udev/rules.d/99-android.rules. And, the syntax is slightly different for Debian. Here is what I used.

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="18d1", MODE="0666"

 

After reloading udev (from a root shell: /etc/init.d/udev restart), I unplugged my phone, and plugged it back in. Bam! It worked!

You may have to substitute 18d1 for your phone’s manufacturer (18d1 is for Nexus-branded devices). Some examples include “0bb4″ for HTC, and “04e8″ for Samsung. You can find the full list over at the Android Developers website.

I sure hope I saved you the headache I experienced!

4 Comments

  1. guy says:

    Nice one! You just saved me a similar 4 hr foray into the bowels of UDEV.

    On the strength of this I have just gained root on my HTC Desire HD, using the “adb” program provided with the Android Linux SDK.
    And I didn’t need to become root on my host PC to communicate with the HTC unit. I try to avoid running root processes unless it is absolutely necessary, as you will appreciate.

    Thanks,

    Guy

  2. tempuserguy says:

    Hey Thanks for sharing this , It really helped. Would I be able to mirror this in part of a blog post im writing for setting up debian for android development , I will of course credit you fully for this information and link to th this article ?.

Post a Comment

You must be logged in to post a comment.

Easy AdSense by Unreal