24 January 2010

ADB driver for Android development

I've been getting into Android development recently, and while the development environment includes an emulator, it's not quite as efficient as using the real thing. Until now, I've been building a run configuration which creates an external APK, then I've transferred that to my HTC Dream and used Linda Manager to install it.

What I'm testing now is the USB ADB interface. I saw this being used in a Google developer video, and it looks rather cool, although it was tricky to install.

These are the steps I used:

1) Inside the Eclipse environment, go to the Window/Android SDK menu option. Select Available Packages, and download the USB Driver Package, revision 3.

2) Go into Control panel, select your Android phone driver (or detect it new if not already done), and select the file android_winusb.inf (which on my system lives in the path C:\Documents and Settings\Administrator\Desktop\android-sdk_r04-windows\android-sdk-windows\usb_driver). Install that, and reboot Windows. (I'm also going to test this with OSX when I change to a Macbook Pro next month for development.)

3) Ensure you have set android:debuggable="true" in the Manifest.xml of your application.

4) In the Settings/Applications/Development menu of your Android phone, set USB debugging to true.

5) Now in Eclipse, when choosing your Run Configuration, your Device Chooser should now have a new entry, assuming your phone is plugged in via a USB cable.

The result of this is that ADB can now directly update and run new applications on the fly on your own phone!

No comments: