If you are like me and like developing in Linux, then you will find this guide useful. When I was setting up everything for my Android development, I ran into the problem that Linux was not recognizing my Android phone, and took me some time figuring out how to make Linux recognize my phone. Finally, after some research I was able to put this little guide together and decided to share it with the rest of the world.
ADB (Android Debug Bridge) is a handy tool that comes with Android SDK that allows you to control and interface with your Android device.
Update: 02/04/11 – HTC changed its Vendor ID, older phones have different ID than newer phones. Refer to USB Vendor IDs table at the bottom of this tutorial to see the change.
Update: 01/02/11 – By mistake I had linked the ADB tool for OSX in step 3.1. Now it should be the correct one for Linux.
IMPORTANT Update 12/11/10 – There has been a change to the new Android SDK. ADB Tool has been moved to /android-sdk-linux_x86/plataform-tools, so if you have the old SDK, please download the new one and update your path (Step 9.2 of this tutorial). If this is your first time doing this, then disregard the update and continue with the tutorial.
Update: 09/21/10 – Working code with Ubuntu Lucid Lynx and added more USB vendor IDs.
- Download the latest Android SDK from Google: Android SDK
- Extract the TGZ file to your home/YOUR-USERNAME directory
- To get ADB, you need to install the SDK: Installing the SDK
- If you are not a developer and not planning to develop, then just download the following zip file containing only the ADB tool and proceed with the tutorial: ADB
- On your phone, click Settings > Applications > Development and make sure USB Debugging is on.
- Login as root and create this file: /etc/udev/rules.d/##-android.rules
NOTE: In the above file replace ## with the number 50 if you are running Gusty/Hardy/Dapper (50-android.rules) or with the number 70 if you are running Karmic Koala/Lucid Lynx/Maverick Meerkat(70-android.rules)- Or simply type in terminal
sudo gedit /etc/udev/rules.d/##-android.rulesthen enter your password
- Or simply type in terminal
- The file should read:
- For Gusty/Hardy: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
- For Dapper: SUBSYSTEM==”usb_device”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
- For Karmic Koala: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
- For Lucid Lynx: SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″
- For Maverick Meerkat: SUBSYSTEM==”usb”, ATTR{idVendor}==”0bb4″, MODE=”0666″
NOTE: In the above lines the code ”0bb4″ refers to a HTC device. If your phone is from a different manufacturer, replace the code with the appropriate from the table below.
NOTE: If you copy one of the lines mentioned above, make sure you replace the quotation marks with the ones in your keyboard, as these have different display code and it might give you a “no permissions” error. - Execute: sudo chmod a+rx /etc/udev/rules.d/70-android.rules
- Reboot
- To run ADB you need to add an environment variable to your bashrc file:
- Open a terminal window and type: sudo gedit .bashrc
- Add the following line at the end: export PATH=${PATH}:/home/YOUR-USERNAME/android-sdk-linux_x86/platform-tools
- Save and close
- You should be ready to go, type
adb devicesin a terminal window with your phone plugged in.
If you see a serial number pop up that means you are done. Should look something like this:
List of devices attached
HT99PHF02521 device - If for some reasons when running
adb devicesgives you a “no permissions” error, try typing the following in terminaladb kill-serveradb start-server
USB Vendor IDs
| Manufacturer | USB Vendor ID |
|---|---|
| Acer | 0502 |
| Dell | 413c |
| Foxconn | 0489 |
| Garmin-Asus | 091E |
| HTC (Older Phones) | 0bb4 |
| HTC (Newer phones) | 18d1 |
| Huawei | 12d1 |
| Kyocera | 0482 |
| LG | 1004 |
| Motorola | 22b8 |
| Nexus One/S | 18d1 |
| Nvidia | 0955 |
| Pantech | 10A9 |
| Samsung | 04e8 |
| Sharp | 04dd |
| Sony Ericsson | 0fce |
| ZTE | 19D2 |
Common ADB Commands
- Lists which devices are currently attached to your computer
adb devices
- Drops you into a basic linux command shell on your phone with no parameters, or lets you run commands directly
adb shell
- Lets you install an Android application on your phone
adb install
- Remounts your system in write mode – this lets you alter system files on your phone using ADB
adb remount
- Rets you upload files to your phones filesystem
adb push
- Lets you download files off your phones filesystem
adb pull
- Starts dumping debugging information from your handset to the console – useful for debugging your apps
adb logcat
Now, as for the credits, I took TheUnlockr “How To” for Windows as a base for this guide.
If you liked this tutorial, please retweet and/or share

esausilva
3
0




Thank you!
Thanks! This gave me the nessessary hints to get it running. However, in debian squeeze (and possibly others) they changed the directory, so the file has to be
/lib/udev/rules.d/50-android.rules
and the content for a motorola defy should be
SUBSYSTEM==”usb”, ATTR{idVendor}==”22b8″, ATTR{idProduct}==”41db”, MODE:=”0666″
thanks for the contribution
someone know id for alcatel devices?
did a quick search…try the one listed here http://stackoverflow.com/questions/8729678/adding-vendor-id-on-linux-for-device-debugging-error-no-permissions
For linux, you have to do:chmod 755 *and you might have to use sudo or just do:sudo -iso you can run everything as root.Hope that helps.
Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) http://t.co/XEDpywf8
This aritcle went ahead and made my day.
Gw pke "Usus Buntu" msh ga bs boss RT @surobledug: Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) http://t.co/2PMMBk6t
Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) « Esau Silva – http://t.co/kzwX05HS
I created the file as 70-android.rules and all of my usb devices got disabled. As a solution i came up with 70-xdroid.rules so that it takes the last position alphabetically for execution as there was couple of other “rules” files tooking place. Guss what, its works. Thanks.
huawei phone u8800 not conet plles
[...] Thanks to Esau Silva for this post that helped get the drivers working for us. http://esausilva.com/2010/05/13/sett…-linux-ubuntu/ [...]
what means number in 70-android.rules and 50-android.rules?
I might be beating a dead horse, but thank you for potisng this!
I found this link that helps if using Debian and Samsung Galaxy Prevail.
http://unforgivendevelopment.com/2011/05/20/udev-headaches-on-debian-testing-wheezy/
Does anyone know the product id and vendor id for milagrow?
Vendor id for milagrow :18D1
what is the milagrow product ur using??
Please go through the below solutions. it will solve your problem definitely.
http://androiddeveloperspot.blogspot.in/2013/01/usb-debugging-in-android-ubuntu.html
Hi, thanks for your tutorial. I have a Samsung GT-S7562 (Galaxy S Duos), which is not recognized by my computer running Linux (Ubuntu12). Unfortunately I had no success. I downloaded only the ADB stuff. I used the code for Maverick Meerkat and the Samsung ID: SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, MODE=”0666″. I then edited the .bashrc as described, which resultetd in “PATH: unknown command”, and I could not sudo any more, so that I had to include the sudo directory to make changes back later. The device list was empty. Later, when the PATH was undone again, I changed to the platform-tools directory und used the ./adb command instead of adb. Device list empty again. What have I done wrong? I assume, the code for my version of ubuntu was not correct. What shall I do?
Thank you….
Thanks a lot. I was searching for this tutorial for months!
This post is great. I realy love it!
Just a note:
Please use lower case for Vendor Id while copying it to android rules file.
for example: if vendor id is -> 18D1
use 18d1
Thanks