Interfacing with Android Phone from GNU/Linux

The following steps will help to interface the Android Phone with the Linux for debugging thru ADB or ADT. After connecting the phone to our Linux Machine through the USB, run the lsusb to get the Vendor and Product ID.

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 04e8:681c Samsung Electronics Co., Ltd
Bus 002 Device 003: ID 0bb4:0c87 High Tech Computer Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

After getting this ids, we can create the uDev rules, which will help us to populate the dev directory dynamically. The UDev rules are available in the /etc/udev/rules.d/. Now we will create one new rule for our new Android Phone, the rule file name is 60-android-phones.rules with permission 0644 and content is:

SUBSYSTEM==”usb”, ATTRS{idVendor}==”04e8″, ATTRS{idProduct}==”681c”, OWNER=”bharathi”

Here I given my user name as the owner. But the proper way is to use the GROUP name like below:

SUBSYSTEM==”usb”, ATTRS{idVendor}==”04e8″, ATTRS{idProduct}==”681c”, GROUP=”plugdev”  <== Samsung Spica
SUBSYSTEM==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0c87″, GROUP=”plugdev”  <== HTC Desire

Make sure that Settings => Applications => Development => USB Debugging option is enabled and run adb commond:

$ adb devices
List of devices attached
5708d55670f7 device <== Samsung Spica
HT05GPL09080 device  <== HTC Desire

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: