Android debug bridge on ubuntu 9.10

It turns out the latest Ubuntu release makes it a bit more difficult to connect the multi purpose Android debug bridge to your Android device. The following is really just an update of my older entry, to remind myself of the changes in Ubuntu 9.10. This stuff is pieced together from various other sources online (mostly android-discuss) and thus not particularly original.

Ok so first of all, there are quite a few more vendors and devices now (yay). In order to identify your device, make sure your device is not connected and then execute the Linux command lsusb.


casper@workstation:~$ lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 07cc:0501 Carry Computer Eng., Co., Ltd Mass Storage
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 046d:c51a Logitech, Inc. MX Revolution/G7 Cordless Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


Now connect the device and make sure USB debugging is enabled, and run the command again. You should have one more line:


casper@workstation:~$ lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 016: ID 0bb4:0c02 High Tech Computer Corp.
Bus 001 Device 004: ID 07cc:0501 Carry Computer Eng., Co., Ltd Mass Storage
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 046d:c51a Logitech, Inc. MX Revolution/G7 Cordless Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub



So now we learned that HTC stands for High Tech Computer. :) We then need to install the rule for the device, by creating a file under /etc/udev/


gksudo gedit /etc/udev/rules.d/51.android.rules


Enter the following, but adjust vendor id and product ID according to what you just found out in the previous step. The device entry below will likely only work if you also happen to have an HTC Magic/Saphire A6161/Nordic (32a).


SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c01", MODE="0666"


Make sure everyone can access and execute it:


sudo chmod a+rx /etc/udev/rules.d/51.android.rules


Now reload the udev service:


sudo service udev reload


Now you are ready to start the adb service. Note that due to a change/bug in the security policies of Ubuntu 9.10, you won't have access to the device unless you execute adb (or rather, the adb service) as a super user. This is mildly annoying:


casper@workstation:~/development/android-sdk-linux/tools$ adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
???????????? no permissions


Instead what you will have to do is start the server manually in super user mode (make sure to kill any existing server first, with sudo adb kill-server):


casper@workstation:~/development/android-sdk-linux/tools$ sudo ./adb start-server
* daemon not running. starting it now *
* daemon started successfully *


And now you may use adb as per usual:


casper@workstation:~/development/android-sdk-linux/tools$ adb devices
List of devices attached
HT95PKF00221 device


Not really groundbreaking stuff, but I thought it might be useful and save time for others running Ubuntu 9.10 and wanting to get ADB up and running.


Update
The Nexus One, Google's latest Android beast, appears to be identified as 18d1:4e11 but without any vendor string. Interesting since the Nexus One is also hardware produced by HTC. However using adb, it will list with serialid: HT9CRP805273 so HTC is not entirely hidden. It appears that internally the phone is referenced as the Passion and/or Mahimahi.

Comments

disco said…
just need to thank you (; ..
I was getting annoyed with my Acer Liquid :P
Anonymous said…
thank you :)
Alex said…
thanks, got it working now. Would have cost me some time to figure this one out....
Unknown said…
Awesome! Your post got my phone recognized by the adb server. Thanks!
velu said…
cool man. It works for me :) thanks.

Note: If you have already started adb-server, please kill that corresponding process and then manually start the server.
MichaelN said…
Unfortunately, it doesn't work on my LG GT540 :-(

lsusb shows:
Bus 005 Device 114: ID 1004:61b4 LG Electronics, Inc.

I've tried to set various options for /etc/udev/rules.d/51-android.rules - without success.
"adb devices" always shows empty list of attached devices
Anonymous said…
I had to do this to get the sudo adb devices to work:
sudo ln -s /usr/local/share/android-tools/adb /usr/local/bin/ (Makes a symbolic link to the adb executable)

After that I got by the nasty no persmissions message.
Anonymous said…
This has failed to work for me with getting Ubuntu 10.10 to recognize my Droid X... Is this because I am on the 10.10 version of Ubuntu or because I'm just a noob?
Casper Bang said…
I don't know Anonymous. What is your problem specifically? How far "do you get"?
Anonymous said…
'So now we learned that HTC stands for High Tech Computer' - This had me laughing out loud because I was just after thinking 'ah so that's what it means'. lol
Anonymous said…
What a life saver. Thx!

Popular posts from this blog

Oracle SQLDeveloper 4 on Debian/Ubuntu/Mint

Beware of SQLite and the Turkish Locale

Rejsekort Scanner