Android Hardware Debugging from Ubuntu in VMWare

Some time back, I had posted an article on Android hardware debugging from Windows. The process is much simpler in Mac OS X or Ubuntu Linux. There, you don’t need to install any special device drivers. Today, I managed to connect my HTC Thunderbolt to Ubuntu 12.04 running as a VMWare guest. The process was simple and worked the first time. Here are the basic steps. I use VMWare Player. I assume the steps will be almost the same for VMWare Workstation.

These steps assume that you have a basic Ubuntu workstation working as a VMWare guest. Log into Ubuntu as the administrator user and then carry out these steps.

Step 1 – Install JDK and Android SDK

You will need Oracle JDK installed. Just download the distribution and unzip it somewhere. Then add <JDK>/bin folder to your PATH. If you are not sure, follow this guide.

Go to http://developer.android.com/sdk/ and download the SDK for Linux. Extract it somewhere, say within your Documents folder. In my case, this created the ~/Documents/android-sdk-linux folder. I will refer to this folder as <SDK> from now on.

Step 2 – Download SDK Platforms

From a command prompt, go to <SDK>/tools. Run this command to open the SDK manager.

./android sdk

Download the version of Android platform that is right for your phone. For example, my phone is running Android 2.3.4. So, I downloaded the nearest Android SDK 2.3.3.

For more information on downloading SDK platforms, read Google’s official guide.

Step 3 – Configure udev

udev is the Linux dynamic device management software. We will need to register our phone as a USB device.

From the command prompt, go to /etc/udev/rules.d folder.

Create a file in that folder called 51-android.rules as follows.

sudo vi 51-android.rules

In that file, I entered a single line for my HTC Thunderbolt.

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="mygroup"

In your case, you will need to enter a different vendor ID (0bb4 is for HTC) and UNIX group that will own the device. For a list of vendor IDs and more information read the official hardware debugging guide.

Then, give read permission to the file for everyone.

sudo chmod a+r 51-android.rules

Step 4 – Plug in the Phone

Before you plugin your phone, enable USB debugging (Settings > Application > Development > USB Debugging).

While the VMWare guest window is in the foreground, plug in the phone to a USB slot. VMWare should automatically connect the guest with the device. Note: a device can be connected to either a guest or the host but not both. The fact that VMWare connected the device to the guest by default saved me a lot of trouble.

Step 5 – Test Connection

From the command prompt, go to <SDK>/platform-tools. Then run this command:

adb devices

Make sure that your phone is listed.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s