I'm trying to figure out how to debug applications directly on my phone (HTC Desire).
I've installed the USB driver that came with the phone and the phone is listed when using "adb devices".
How do I configure eclipse/ADT to launch on the phone instead of launching the emulator/virtual device?
Double-click on a breakpoint to jump to its locations in the source code. Mark or unmark a breakpoint to activate or deactivate it. Any such changes are effective immediately in the current debugging session. The editor showig the code that you are debugging.
On the device, open the Settings app, select Developer options, and then enable USB debugging (if applicable). Note: If you do not see Developer options, follow the instructions to enable developer options. Set up your system to detect your device.
either start the app by right clicking on the project and select Debug As -> Android Application or by running it normally and later in the DDMS perspective select the running app in your devices pane and click on the green bug.
Select Help > Software Updates. Select the Available Software tab. If there are updates available, select Android DDMS, Android Development Tools, and Android Hierarchy Viewer, then click Update. In the resulting Available Updates dialog, ensure that each of the listed tools are selected, then click Next.
With an Android-powered device, you can develop and debug your Android applications just as you would on the emulator.
1. Declare your application as "debuggable" in AndroidManifest.xml
.
<application android:debuggable="true" ... > ... </application>
2. On your handset, navigate to Settings > Security and check Unknown sources
3. Go to Settings > Developer Options and check USB debugging
Note that if Developer Options
is invisible you will need to navigate to Settings > About Phone and tap on Build number
several times until you are notified that it has been unlocked.
4. Set up your system to detect your device.
Follow the instructions below for your OS:
Install the Google USB Driver from the ADT SDK Manager
(Support for: ADP1, ADP2, Verizon Droid, Nexus One, Nexus S).
For devices not listed above, install an OEM driver for your device
Your device should automatically work; Go to the next step
Add a udev
rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer is identified by a unique vendor ID, as specified by the ATTR{idVendor} property. For a list of vendor IDs, click here. To set up device detection on Ubuntu Linux:
/etc/udev/rules.d/51-android.rules
.SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
chmod a+r /etc/udev/rules.d/51-android.rules
Note: The rule syntax may vary slightly depending on your environment. Consult the udev documentation for your system as needed. For an overview of rule syntax, see this guide to writing udev rules.
5. Run the project with your connected device.
With Eclipse/ADT: run or debug your application as usual. You will be presented with a Device Chooser dialog that lists the available emulator(s) and connected device(s).
With ADB: issue commands with the -d flag to target your connected device.
Still need help? Click here for the full guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With