[Linux] Android rules file [12.28.2012]

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
So this is just to save the people who use Linux and do Android stuff some trouble, it is merely a compiled list of vendor ID's for many phone manufacturers so that ADB and Fastboot can recognize your device.
Note: For other distributions the instructions would be very similar, you would only be swapping out the "/etc/udev/rules.d/51-android.rules" path for one specific to your distro. Consult Google for specifics, but the content of that file can be copied from the download link below and still work.

Instructions (Ubuntu/Ubuntu-based only):
  1. Download this file: 51-android.rules
  2. Open a terminal
  3. Type in
    Code:
    $  sudo gedit /etc/udev/rules.d/51-android.rules
  4. Open the file you downloaded above and copy and paste the content into the blank file you opened from terminal
  5. Save the file that was originally blank (and now has content) and close it
  6. Back in terminal type
    Code:
    $  sudo chmod a+r /etc/udev/rules.d/51-android.rules
  7. Now you need to restart the udev service, so try the following commands ONE at a time until one of them works (doesn't give errors). If you'd rather NOT restart udev, you can also reboot for the changes to take effect.
    Code:
    service udev restart
    sudo /etc/init.d/udev restart
    sudo reload udev
    sudo udevadm trigger
  8. In terminal, either cd to your ADB directory (if not set in your $PATH) and run this
    Code:
    $  ./adb devices
    or if it is in your path, run this
    Code:
    $  adb devices
    Any connected devices should show up
  9. You're done, you can now use adb to connect to your Android device, even if you get a new phone as the definitions in the file cover a large range of manufacturers

Download link: 51-android.rules
I will keep this updated if any new manufacturers show up in the Android market.
 
Last edited:

strapped365

Senior Member
Mar 14, 2011
5,161
2,797
0
Columbus
Nice....I might just be adding this to Mint. As it sits now only HTC devices show in adb all other devices give me the famous
no permissions ?????? Output. But I only add the HTC vendor. Thanks for sure though

Sent from my myTouch_4G_Slide using Tapatalk 2
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
Nice....I might just be adding this to Mint. As it sits now only HTC devices show in adb all other devices give me the famous
no permissions ?????? Output. But I only add the HTC vendor. Thanks for sure though

Sent from my myTouch_4G_Slide using Tapatalk 2
Yup, thats why I keep this file in my dropbox for when I get more devices
And yeah, I remember you said you might be trying out Ubuntu so I just wanted to help out :)
 

strapped365

Senior Member
Mar 14, 2011
5,161
2,797
0
Columbus
went from Mint 14 back to Mint 13 today and used this as a 99-android.rules and it worked out for HTC. cant say anything about the rest all i own is HTC. thanks again man
 

Quetzalcoatl

Senior Member
Jan 12, 2012
1,070
345
0
went from Mint 14 back to Mint 13 today and used this as a 99-android.rules and it worked out for HTC. cant say anything about the rest all i own is HTC. thanks again man
Ubuntu 12.10 recognized my lte on a fresh adb install. I was surprised I had to do no edits since my shift always gave me trouble.lol

Sent from my EVO using xda app-developers app
 

strapped365

Senior Member
Mar 14, 2011
5,161
2,797
0
Columbus
Ubuntu 12.10 recognized my lte on a fresh adb install. I was surprised I had to do no edits since my shift always gave me trouble.lol

Sent from my EVO using xda app-developers app
My Shift MyTouch 4G Slide and G2 all throw fits so this made it super easy not to see

????????? No permissions lol

Sent from my myTouch_4G_Slide using Tapatalk 2
 
  • Like
Reactions: Quetzalcoatl

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
Ubuntu 12.10 recognized my lte on a fresh adb install. I was surprised I had to do no edits since my shift always gave me trouble.lol

Sent from my EVO using xda app-developers app
Lol it shouldnt by default...:confused:
Run:
Code:
sudo gedit /etc/udev/rules.d
And see if its empty or not
I'm thinking that maybe when you install the adb tools package, it creates that file for you....i'm not sure though, I install my adb manually by downloading the ADT_Bundle.tar.gz file
But then again, maybe some phones just work :good:

Sent from my PG06100 using xda premium
 

Quetzalcoatl

Senior Member
Jan 12, 2012
1,070
345
0
My Shift MyTouch 4G Slide and G2 all throw fits so this made it super easy not to see

????????? No permissions lol

Sent from my myTouch_4G_Slide using Tapatalk 2
That always drove me nuts.
I used to think a lot of the edits didnt work but I just kept forgetting to kill the server and restart it lol

Lol it shouldnt by default...:confused:
Run:
Code:
sudo gedit /etc/udev/rules.d
And see if its empty or not
I'm thinking that maybe when you install the adb tools package, it creates that file for you....i'm not sure though, I install my adb manually by downloading the ADT_Bundle.tar.gz file
But then again, maybe some phones just work :good:

Sent from my PG06100 using xda premium
Came out empty lol
 
  • Like
Reactions: CNexus

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
That always drove me nuts.
I used to think a lot of the edits didnt work but I just kept forgetting to kill the server and restart it lol



Came out empty lol
Wait the command was supposed to be this, my b:
Code:
sudo gedit /etc/udev/rules.d/51-android.rules
Sent from my PG06100 using xda premium
 

blmvxer

Senior Member
Jan 13, 2012
1,482
607
0
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="109b", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="10a9", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2340", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"

These are all the devices listed on googles website for ADB, Just copy and paste this into your android.rules. :)
 

strapped365

Senior Member
Mar 14, 2011
5,161
2,797
0
Columbus
Well i guess you can paste exactly whats in the file I uploaded....

Sent from my PG06100 using xda premium
That's what I did and it was the first time ever it didn't take an 8 digit vendor number. Like how HTC is 0bb4 my Linux installs always wanted 0bb4 : xxxx ( don't remember last 4 )

Sent from my myTouch_4G_Slide using Tapatalk 2
 

CNexus

Senior Member
May 17, 2012
9,009
13,993
263
~/android
I think it varies between distros
On ubuntu it just takes a 4 digit one
But to make sure i understood...the 4 digit numbers worked for you or not...?

Sent from my PG06100 using xda premium
 

Quetzalcoatl

Senior Member
Jan 12, 2012
1,070
345
0
That's what I did and it was the first time ever it didn't take an 8 digit vendor number. Like how HTC is 0bb4 my Linux installs always wanted 0bb4 : xxxx ( don't remember last 4 )

Sent from my myTouch_4G_Slide using Tapatalk 2
I think the last 4 are device model specific. I dunno.

Sent from my EVO using xda app-developers app
 

strapped365

Senior Member
Mar 14, 2011
5,161
2,797
0
Columbus
I think it varies between distros
On ubuntu it just takes a 4 digit one
But to make sure i understood...the 4 digit numbers worked for you or not...?

Sent from my PG06100 using xda premium
All I ever run is a derivative of Ubuntu. And have for the last year. I wish my Linux machine would boot Ubuntu full but it won't.

Yes sir by far the easiest way to get adb going. It took me no more than 30 seconds





I think the last 4 are device model specific. I dunno.

Sent from my EVO using xda app-developers app
I'll have to plug all my devices in a run lsusb again to check. But if I remember right they are. But for some reason my PC needed all 8 before adb would work on any device.

Sent from my myTouch_4G_Slide using Tapatalk 2