Android device debugging (HTC Desire)
I'm just starting to play around with Android development and, while you can get going with the emulator, I wanted to get setup for debugging my programs actually running on real hardware. It wasn't trivial on my HTC Desire (which wasn't supported out of the box by the standard USB driver) so here are the steps I had to go through - this info is mostly summarizing the Android developer docs except where stated.
Declare the app as debuggable in the Manifest by adding android:debuggable="true" to the <application> tag
Turn on USB Debugging on your device in Settings/Applications/Development
Modify USB driver android_winusb.inf (inf is in ...\android-sdk-windows\usb_driver) For the Desire add the following to the [Google.NTx86] and [Google.NTamd64] sections (found in the comments here)
;HTC Desire %SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C87 %CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C87&MI_01 ;
and for the Wildfire (from here)
; HTC Wildfire %SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C8B %CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C8B&MI_01 %SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C8B
Install USB driver as per the standard instructions (but obviously using your modified inf file)
To verify, connect your device if it's not already and execute adb devices
from the sdk tools directory. You should see your device, as well as the emulator if it is running. While connected, start to debug from Eclipse - if the emulator is also running you get to choose whether to debug on your hardware or the emulator.