Jump to content

  1. 0
  2. 0
  3. 0/5

Rate this Topic

- - - - -

uDev Rules for Any Device! (No more starting adb with sudo)

  • Please log in to reply

OP dustinmj

dustinmj

Developer

  • 84 posts

Posted 13 June 2011 - 12:26 AM #1

Ok, so I was hopping along the bunny trail... and realized, nobody has ever posted a set of uDev rules for Ubuntu that work with any device and Ubuntu version > 7.10... (up until now, there's udev results for specific devices, some wrong, some crazy, none all together)... so, I though I'd do the honor :kiss:

Here's the low down, read and complete all of the steps before telling me it doesn't work, please.

  • First, remove any rules you already set up for your Android Device (If any), they'll be very obvious if you look in /etc/udev/rules.d/

    sudo ls /etc/udev/rules.d/
  • Now, open an editor for the rules at /etc/udev/rules.d/99-android.rules:

    gksudo gedit /etc/udev/rules.d/99-android.rules
  • Now, paste all of the rules below:

    #Acer
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0502", MODE="0666"
    #Dell
    SUBSYSTEM=="usb", SYSFS{idVendor}=="413c", MODE="0666"
    #Foxconn
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0489", MODE="0666"
    #Garmin-Asus
    SUBSYSTEM=="usb", SYSFS{idVendor}=="091E", MODE="0666"
    #Google
    SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
    #HTC
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
    #Huawei
    SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
    #Kyocera
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0482", MODE="0666"
    #LG
    SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
    #Motorola
    SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
    #Nvidia
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0955", MODE="0666"
    #Pantech
    SUBSYSTEM=="usb", SYSFS{idVendor}=="10A9", MODE="0666"
    #Samsung
    SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
    #Sharp
    SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666"
    #Sony Ericsson
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
    #ZTE
    SUBSYSTEM=="usb", SYSFS{idVendor}=="19D2", MODE="0666"
  • Save and close the file.
  • Change the file permissions:
    sudo chmod a+r /etc/udev/rules.d/99-android.rules
  • Now, unplug all Android Devices...
  • Restart the udev service:
    sudo service udev restart
  • Kill and restart adb:
    adb kill-server
    adb start-server
  • Done... you should now be able to work with a device from almost any manufacturer. Plug your phone in to test.

If you're unable to start adb from a command line anywhere (without sudo), you've been lazy with your setup (I am too at times)... you may want to scan my "Dev Box Setup" series of blog posts.

At any rate, just wanted to share these udev rules.

-Dustin

Edited by dustinmj, 13 June 2011 - 03:16 AM.

  • 10 Likes
"May you be in heaven half an hour before the devil knows you're dead."

birdman

birdman

Super Amazing Elite Recognized Developer

Posted 13 June 2011 - 02:41 AM #2

This is hands down the most useful thing anyone could have done. Awesome work :kiss:
  • 0 Likes

OP dustinmj

dustinmj

Developer

  • 84 posts

Posted 13 June 2011 - 03:13 AM #3

This is hands down the most useful thing anyone could have done. Awesome work :D


Thanks bro :)
  • 0 Likes
"May you be in heaven half an hour before the devil knows you're dead."

ChainsDD

ChainsDD

Superuser

  • 8 posts

Posted 13 June 2011 - 07:45 AM #4

Great post! This will solve a lot of devs issues. Thank you!
  • 0 Likes

P3Droid

P3Droid

Average Android

  • 1 posts

Posted 13 June 2011 - 07:46 AM #5

great info, i'm going to miss typing sudo all the time, LOL, actually i'm not.
  • 0 Likes

parkjam

parkjam

Android Apprentice

  • 22 posts

Posted 13 June 2011 - 08:10 AM #6

Great info, thanks!
  • 0 Likes

mwaters33

mwaters33

Android Lover

Posted 13 June 2011 - 10:18 AM #7

I've been trying to get this to work for 2 days and need help.

If I type lsusb it displays my device, but adb devices returns a blank. No?????? or anything about permissions (I set udev rules already anyway). It just acts like the device isn't there. USB debugging is on, I checked that repeatedly.
  • 0 Likes

OP dustinmj

dustinmj

Developer

  • 84 posts

Posted 14 June 2011 - 09:18 PM #8

I've been trying to get this to work for 2 days and need help.

If I type lsusb it displays my device, but adb devices returns a blank. No?????? or anything about permissions (I set udev rules already anyway). It just acts like the device isn't there. USB debugging is on, I checked that repeatedly.


Based on your explanation, I'm at a loss for answers... I'm going to open up a support thread for my Blog Series, you may wish to post in there and see if anyone else has an answer for you.
  • 0 Likes
"May you be in heaven half an hour before the devil knows you're dead."

Sniffle

Sniffle

Android Beginner

  • 3 posts

Posted 26 June 2011 - 07:02 AM #9

so glad i don't have to support my original how-to guide anymore :-) it is a lot of work to keep up with it all. you guys are doing a great job!
  • 0 Likes

JASKRU

JASKRU

reenigne esrever

Posted 14 July 2011 - 07:56 AM #10

Thanks for posting this as well as your dev box guide. Great to see people sharing information.
  • 0 Likes