Friday, June 24, 2011

Using LG Optimus 2X under USB debugging mode on Ubuntu

If you want to develop/debug applications or even connect ddms/adb to your LG-O2X, you need to setup udev rules, in order for it to be detected by the OS. I'm assuming here that you have already installed android SDK for this purpose, if not please do so (google it!) before proceeding.

In order to do this, at first you need to open a terminal Applications->Accessories->Terminal. Then type in the following commands into your terminal. As soon as you enter the command below, you might be prompted for your password. Enter it to proceed with privileged access.
    gksudo gedit /etc/udev/rules.d/90-android.rules

In the text editor which opens, enter the following line:
BUS=="usb", SYSFS{idVendor}=="1004", OWNER="<userName>", GROUP="<groupName>"
Where: 
1. <userName> is your user name on this machine. Yes! this means that this setting only works you alone! 
2. <groupName> is the name of the group you belong to on this machine. 
3. 1004 is the vendor ID of LG (Courtesy: theandroidphone) 
4. (Google on how to get your username and groupname if you don't know!)

Save and close this file. Then type the following command on your terminal:
    gksudo service udev restart

After this is done, plug-in the USB cable of your phone (if it's already plugged in, remove and re-plug) and in your phone enable USB debugging by: Settings->Applications->Development->USB debugging.

Then type the following command to make sure your phone is getting detected:
    adb devices
You should see something like below in the terminal:
List of devices attached
XXXXXXXXXXXXXXXX    device

PS: All this information is from my PC running Ubuntu-10.10 (the Maverick Meerkat).

No comments:

Post a Comment