Archive for May, 2010
How to connect your Android phone to Ubuntu to do development, testing, installations or tethering
If you do any Android development in Ubuntu it is much better to test your applications on a real device rather than just relying on the emulator.
If you just connect the phone to the computer through USB and run adb devices you will find out that your phone is not recognized:
$ adb devices
List of devices attached
???????????? no permissions
This is easily fixable in Ubuntu. You have to add a line to a file in the /etc/udev/rules.d directory.
What line in which file depends on the manufacturer and model of the device. You can find out the Vendor ID number and Product ID number of the device by running (after you connected it via USB of course):
$ lsusb
For example, if you had a Nexus One connected you would get:
Bus 002 Device 004: ID 18d1:4e12
In this case the Vendor Id is “18d1″ and the Product ID is “4e12″. Please keep in mind that the Vendor ID for HTC changed from “0bb4″ to “18d1″. The older HTC phones like the G1 have a Vendor ID of “0bb4″.
Here is how to set up some of the major Android phones:
Step 1. Depending on your phone follow these instructions:
- G1
Create/edit a file in /etc/udev/rules.d called 51-android.rules:$ sudo gedit /etc/udev/rules.d/51-android.rulesAdd the following line to it and save it:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c01″, MODE=”0666″
- HTC Hero
Create/edit a file in /etc/udev/rules.d called 51-android.rules:$ sudo gedit /etc/udev/rules.d/51-android.rulesAdd the following line to it and save it:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c02″, MODE=”0666″
- Motorola Droid
Create/edit a file in /etc/udev/rules.d called 10-motorola-droid.rules:$ sudo gedit /etc/udev/rules.d/10-motorola-droid.rulesAdd the following line to it and save it:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”22b8″, ATTRS{idProduct} ==”41db”, MODE=”0600″
- Nexus One
Create/edit a file in /etc/udev/rules.d called 99-android.rules:$ sudo gedit /etc/udev/rules.d/99-android.rulesAdd the following line to it and save it:
SUBSYSTEM==”usb”, ATTRS{idVendor}==”18d1″, SYMLINK+=”android_adb”, MODE=”0666″
Step 2. Restart udev:
$ sudo restart udev
Check if the device is recognized:
$ adb devices
You may need to stop and start the adb server:
$ adb kill-server
$ adb start-server
You should be good to go…
Search
Archive
Recent Comments
- SteveO on Android applications that use the MyLocationOverlay class crash on the new Droid X
- dimitar on Clone Disk Drives with Ubuntu. Make an Exact Copy of Your Hard Drive.
- ranskalex on Clone Disk Drives with Ubuntu. Make an Exact Copy of Your Hard Drive.
- Jack on Quickly remove special characters from file names
- dimitar on Quickly remove special characters from file names
Categories
Blogroll
Online Tools
Other
BLOG ARCHIVE
- August 2010 (2)
- July 2010 (2)
- June 2010 (2)
- May 2010 (1)
- January 2010 (2)
- December 2009 (2)
- November 2009 (3)
- October 2009 (1)
- September 2009 (3)
- July 2009 (1)
- May 2009 (1)
- March 2009 (1)
- February 2009 (2)
- January 2009 (2)
- December 2008 (1)
- November 2008 (4)
- October 2008 (5)