Tuesday, May 22, 2012

Setup Multiple Devices for Android Development

I didn't find good resources in setting up multiple devices for android development.  When using Windows, if devices are plugged in via usb, it automatically installs the driver.  In Linux, it's different.  You have to do it manually.  Good example is in Android Developer page but this doesn't answer my problem. I have my LG device and 2 of our test devices at work (HTC and Samsung Galaxy Tab).  So I have to test it myself and here's what I did.

Go to rules.d directory
$ home_dir/etc/udev/rules.d


Create a file for each device
$ vim 51-android.rules
$ vim 61-android.rules
$ vim 71-android.rules

On the content, change the ATTR{idVendor} to specific USB Vendor IDs
For LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"

Lastly, change the file permission
chmod a+r /etc/udev/rules.d/51-android.rules

Restart udev
$ sudo restart udev

To check, use adb command.
android_sdk_dir$ ./adb devices
List of devices attached 
emulator-5554     device
HT115HL12346     device
46411929E53773CE    device
It should display the list of devices...


Do you have any other methods? Put it on the comments.