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 very much…I changed the quotation to the one on my keyboard and it worked…I really appreciate your help…
I can’t get this to work on Natty Narwhal. I’m not sure if I have to change the filename or the content itself?
##-android.rules
Anybody knows what this number should be for natty? This used to work before I did an upgrade on ubuntu ( the previous number was 51)
Well, I haven’t tried Natty Narwhal…try creating a different android rules file and with a higher value number, 71 maybe?? 80?, 90? and see if that works
Thank you very much ^^ this is very useful..
I’m using Natty and 70-android.rules works for me.
by the way I hope you don’t mind because I use this guide as the base to answer the topic in android-indonesia forum about how to setting up adb on linux, and I’ve translated it into Bahasa Indonesia
http://www.android-indonesia.com/home/15-developers/60129-menghubungkan-terminal-ubuntu-dengan-android#60193
Thanks for letting me know that 70 works for Natty….and don’t mind at all
99.android.rules with
SUBSYSTEMS==”usb”, MODE=”0666″, SYSFS{idVendor}==”0502″
works for me in natty with adb
He sorry to bother you but I followed the guide to the letter and I still can’t get my adb commands to work in ubuntu. Here is my console,
diezel@ubuntu:~$ adb
bash: /usr/bin/adb: No such file or directory
diezel@ubuntu:~$
No matter what I do to configure adb this error shows up. I would appreciate any help available. Thanks for the guide!
Sorry for the double post that was an old console command heres whats happening,
diezel@ubuntu:~$ adb devices
bash: /home/diezel/android-sdk-linux_x86/platform-tools/adb: No such file or directory
Kk, Boleh numpang Co-Paste?
ane cantumkan Sumbernya Kk
Kk, boleh numpang Co-Paste ?
Ane cantumkan sumbernya Kk
??????-??! ? ???????? ???? ?????? ???????? Android ?????????? ?? ???????? ????????! ??????????? ??? http://j.mp/ggLTdN!
??????-??! ? ???????? ???? ?????? ???????? Android ?????????? ?? ???????? ????????! ??????????? ??? http://j.mp/ggLTdN!
??????-??! ? ???????? ???? ?????? ???????? Android ?????????? ?? ???????? ????????! ??????????? ??? http://j.mp/ggLTdN!
Thx, worked perfectly on Natty with a Samsung Galaxy S.
I’m having trouble getting my Galaxy S (Fascinate) to register through adb devices.
central rules.d # adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
central rules.d # adb devices
List of devices attached
I get blank. but my phone gets recognized by the system.
central rules.d # lsusb
Bus 004 Device 008: ID 04e8:681d Samsung Electronics Co., Ltd Galaxy Portal/Spica Android Phone
Any ideas?
Thanks for sharing this useful guide and the adb package. I didn’t wanted to install the entire SDK. Excuse my poor English.
SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4?, MODE=”0666?
this driver is applicable for phone in operate condition, once phone set in FASTBOOT or HBOOT the driver will not recognized
@x1123
Thank you so much…! Finally got my Galaxy S talking to Natty
works for me in Natty 70-android.rules
SUBSYSTEM==”usb”, SYSFS{idVendor}==”04e8″, MODE=”0666″
only on-board USB detects the device. not able to get it work through my PCI USB card
[...] ???“USB Vendor ID”?USB?????????????????????????????????Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu)?????? [...]
?????????? ADB (Android Debug Bridge) ?? Linux http://t.co/nkIr0Xl
Thnx! great resource!
You almost never have to reboot a linux machine in order to install something, unless it has to do with the kernel itself.
Instead of step 8, use the following command:
sudo restart udev
For those on other distros that may not use upstart, the command is
sudo /etc/init.d/udev restart
Thank for the tip
Thanks ! Got worked in Maveric after your instructions. But need to sudo adb . doesn’t work without sudo …. Great Thanks a lot !
Hi, thanks for your help. I am trying to move apps from internal storage to SD card, and I need to use adb. After following the official dev guide and your post, I achieved my goal. There are two points that might help others.
1)
“lsusb” will show you connected USB devices, and it’s easier to check/confirm the vendor ID there.
2)
for “no permission”: if user is not the root, “adb start-server” won’t fix the permission. Make sure you execute this command with admin privilege.
Very cool, It help me a lot setting my Ubuntu and Fedora with Android
Thanks for the help.
Worked nicely!
Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) http://t.co/H42CZCjz via @AddToAny
[...] [...]
Seems helpful up to a point. I note there are a few differences between debian/ubuntu and redhat/mandrake/mandriva/mageia type distros. Well, some help is better than none, and thanks for the pointers here, it still helped a little for my choice of distro. Thanks.
Thank you. I can use my kyros 7022 with eclipse now that I did your tutorial.
If someone need i used the id “18d1″.
[...] http://esausilva.com/2010/05/13/setting-up-adbusb-drivers-for-android-devices-in-linux-ubuntu/ [...]
RT @TopsyRT: Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) http://t.co/V1owumZi
For Ubuntu Linux 64 bit machines you have to install the 32 bit libraries to get adb to run. From a terminal type: sudo apt-get install ia32-libs
thanks for the info
“type adb devices in a terminal window with your phone plugged in.”
tom@tom:~$ adb devices
No command ‘adb’ found, did you mean:
Command ‘cdb’ from package ‘tinycdb’ (main)
Command ‘gdb’ from package ‘gdb’ (main)
Command ‘aub’ from package ‘aub’ (universe)
Command ‘dab’ from package ‘bsdgames’ (universe)
Command ‘zdb’ from package ‘zfs-fuse’ (universe)
Command ‘mdb’ from package ‘mono-debugger’ (universe)
Command ‘tdb’ from package ‘tads2-dev’ (multiverse)
Command ‘pdb’ from package ‘python’ (main)
Command ‘jdb’ from package ‘openjdk-6-jdk’ (main)
Command ‘ab’ from package ‘apache2-utils’ (main)
adb: command not found
Sure thought I did it right
hello
i had the same problem
you cant use (“) you must use (‘)
enyway that was my keyboard’s system
Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) « Esau Silva http://t.co/qC2e5l5s
Great help, just wanted to thank you.
Cheers
Awesome writeup!
However, I can’t find my device by using lsusb even though I’ve enabled/re-enabled usb debugging. Don’t know what can be wrong. I’ve tried to follow all your steps. So, I have ADB up and running without any devices being listed.
Regardless. At the very least my device should show up with ‘lsusb’? What can be preventing me discovering the device through that command?
I’m on Oneiric Ocelot. 11.10.
Cheers,
Nils
what is your device?
maybe you can find your device listed here ids
i have the same problem as NilsNH =(
I’m on Oneiric Ocelot. 11.10.
my device is samsung galaxy s5670
so your device does not show up with lsusb? Can your computer read your device as external storage? try this ’689e’ or this ’04e8′ as vendor id …. you can find your device listed here ids
Ubuntu + Android via ADB-Bridge. So gehts schnell und einfach.
http://t.co/wg7wrjQt
RT @TopsyRT: Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) http://t.co/qOC4ZZTQ
http://t.co/RrjzDAlL #adb #android
Same problem as Diezel –
$ adb
bash: /usr/bin/adb: No such file or directory
Ideas? Suggestions? Thanks!
Adb is not found under /usr/bin, it’s found under your Android SDK directory. Look at step 9 on my tutorial
I had the same problem.
What worked for me was this:
open the folder home/you/android-sdk-linux/tools
double click on “android”
This will start the sdk manager. Wait for it to load all files.
Under tools, you can install “platform-tools”
close
Finally, adb should work!
Thanks a lot buddy!! worked perfectly on Lucid..
Oh, and you have to change the udev rules for Debian, with appropriate vendor id:
SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, ATTRS{idVendor}==”0fce”, MODE=”066
6″
Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) « Esau Silva http://t.co/M05kZjjZ #android
both
SUBSYSTEM==”usb”, ATTR{idVendor}==”19d2″, MODE=”0666″
SUBSYSTEM==”usb”, SYSFS{idVendor}==”19d2″, MODE=”0666″
works for me(Lucid Lynx)
but replugin required.
$ adb devices
List of devices attached
N600PLUS_CHINATELECOM device
[...] device for debugging (ADB) does not work – Stack Overflow Found the vendor information here: Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu) Esau Silva Also, there are a lot of useful adb commands on that page, makes a great [...]
Definitely this blog is very informative and neatly designed. Really you’ve motivated me strongly in my new project by this article. As a constant reader of your blog I want to tell you that your writing skills are superb.
help plz, after running ‘adb devices’ in terminal, i get-
“List of devices attached
???????????? no permissions”
[...] 12d1 ????????????????? [...]
This is a great post. Thank you and Google for chance to read it.
Amazing. I can’t thank you enough for putting something useful and correct onto the internet and so easy to follow.
Thank you man! Helped me very much. =D
I followed this guide ,and it works .But after I reboot the system ,the file ##-android.rules disappears ,and I have to do all again every time after I reboot the system .Can you please tell me how to fix it ?Thanks a lot !