HowTo set up the Android SDK on Ubuntu for HTC Phones

Image representing HTC as depicted in CrunchBase
Image via CrunchBase

In this post I will explain how I set up the Android SDK on Ubuntu for my HTC Desire.

I first followed the steps for Ubuntu as described in Setting up a Device for Development:

With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator. Before you can start, there are just a few things to do:

  1. Declare your application as “debuggable” in your Android Manifest.In Eclipse, you can do this from the Application tab when viewing the Manifest (on the right side, set Debuggable to true). Otherwise, in the AndroidManifest.xml file, add android:debuggable="true" to the <application> element.
  2. Turn on “USB Debugging” on your device.On the device, go to the home screen, press MENU, select ApplicationsDevelopment, then enable USB debugging.
  3. Setup your system to detect your device.
    • If you’re developing on Ubuntu Linux, you need to add a rules file that contains a USB configuration for each type of device you want to use for development. Each device manufacturer uses a different vendor ID. The example rules files below show how to add an entry for a single vendor ID (the HTC vendor ID). In order to support more devices, you will need additional lines of the same format that provide a different value for the SYSFS{idVendor} property. For other IDs, see the table of USB Vendor IDs, below.
      1. Log in as root and create this file: /etc/udev/rules.d/51-android.rules.For Gusty/Hardy/Maverick Meerkat, edit the file to read:
        SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

        For Dapper, edit the file to read:
        SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"

      2. Now execute:
        chmod a+r /etc/udev/rules.d/51-android.rules

You can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you’ll see the device name listed as a “device.”

When I executed adb devices the name of my HTC Desire just looked like “??????????”. After executing reload udev then disconnecting and connecting my phone again, everything looked fine. Now I could see the name of my HTC Desire after running adb devices.

Maybe this post helps you in setting up your Android SDK on Ubuntu. If it does please drop me a comment below.

(Thanks to the post of it-slav.net)

Enhanced by Zemanta

1 thought on “HowTo set up the Android SDK on Ubuntu for HTC Phones”

Leave a Reply

Your email address will not be published. Required fields are marked *