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. Enable Unknown sources and USB debugging:
Go to Settings -> Applications and check the Unknown sources check-box, then go to Development and enable the USB debugging.
Step 2. 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
Add to the file (or create it if it does not exist- see above) /etc/udev/rules.d/51-android.rules the following line:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c02″, MODE=”0666″
- HTC EVO
Add to the file (or create it if it does not exist- see above) /etc/udev/rules.d/51-android.rules the following line:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c8d”, MODE=”0666″
- HTC EVO Shift
Add to the file (or create it if it does not exist- see above) /etc/udev/rules.d/51-android.rules the following line:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0ca5″, MODE=”0666″
- HTC ThunderBolt
Add to the file (or create it if it does not exist- see above) /etc/udev/rules.d/51-android.rules the following line:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0ca4″, MODE=”0666″
- LG OPTIMUS LG-P506
Add to the file (or create it if it does not exist- see above) /etc/udev/rules.d/51-android.rules the following line:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”1004″, ATTRS{idProduct}==”618e”, MODE=”0666″
- Motorola Xoom
Add to the file (or create it if it does not exist- see above) /etc/udev/rules.d/51-android.rules the following line:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”22b8″, ATTRS{idProduct}==”70a9″, 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 3. 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
Update: Please note that some devices require to disconnect the usb cable at this point and then reconnecting it.
You should be good to go…
Search
Archive
Recent Comments
- Olivier on Dynamic Port Forwarding with SOCKS over SSH
- Ld7 on How to connect your Android phone to Ubuntu to do development, testing, installations or tethering
- get more Info on How to get Picasa images using the Image Picker on Android devices running any OS version
- Casper on How to detect a user pan/touch/drag on Android Map v2
- Install SSH as socks proxy for dynamic port forwarding | Steve Constine on Dynamic Port Forwarding with SOCKS over SSH
Categories
Blogroll
Online Tools
Other
BLOG ARCHIVE
- April 2013 (1)
- November 2012 (2)
- August 2012 (1)
- May 2012 (1)
- March 2012 (1)
- November 2011 (1)
- August 2011 (1)
- April 2011 (1)
- January 2011 (2)
- September 2010 (1)
- 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)