HowTo set up the Android SDK on Ubuntu for HTC Phones

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"`</p> 
        For Dapper, edit the file to read:
        `SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"`</li> 
        
          * Now execute:
            `chmod a+r /etc/udev/rules.d/51-android.rules`</ol> </li> </ul> </li> </ol> 
        
        You can verify that your device is connected by executing `adb devices` from your SDK `platform-tools/` directory. If connected, you&#8217;ll see the device name listed as a &#8220;device.&#8221;</blockquote> 
        
        When I executed **_adb devices_** the name of my HTC Desire just looked like &#8220;??????????&#8221;. 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 <a title="it-slav.net" href="http://www.it-slav.net/blogs/2010/05/01/hint-howto-get-android-sdk-working-on-ubuntu/" target="_blank">it-slav.net</a>)
        
        ### Related articles {.zemanta-related-title}
        
        <ul class="zemanta-article-ul">
          <li class="zemanta-article-ul-li">
            <a href="http://sichent.wordpress.com/2010/11/04/install-android-sdk-and-ndk/">Install Android SDK and NDK</a> (sichent.wordpress.com)
          </li>
          <li class="zemanta-article-ul-li">
            <a href="http://techblissonline.com/android-3-sdk-download/">Download Android 3.0 SDK</a> (techblissonline.com)
          </li>
          <li class="zemanta-article-ul-li">
            <a href="http://www.howtoforge.com/setting-up-an-android-app-build-environment-with-eclipse-android-sdk-phonegap-ubuntu-10.10">Setting Up An Android App Build Environment With Eclipse, Android SDK, PhoneGap (Ubuntu 10.10)</a> (howtoforge.com)
          </li>
          <li class="zemanta-article-ul-li">
            <a href="http://techblissonline.com/download-android-sdk-install-and-develop/">Download Android SDK, Install and Develop Android Apps</a> (techblissonline.com)
          </li>
        </ul>
        
        <div class="zemanta-pixie">
          <a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=ca4aa06d-094b-478c-b803-969bea0f697f" alt="Enhanced by Zemanta" /></a>
        </div>