2.13 Connecting to an application that is already running on an Android target

This tutorial describes how to connect to and debug an application that is already running on an Android target.

Note

Use of the Android development kits are subject to their own terms and conditions.

Procedure

  1. Launch Eclipse.
  2. Connect the host workstation to the target.
  3. Ensure that the application is already installed and running on the target.
  4. Select Debug Configurations... from the Run menu.
  5. Select DS-5 Debugger from the configuration tree and then click on New to create a new configuration. Alternatively you can select an existing DS-5 Debugger configuration and then click on Duplicate from the toolbar.
  6. In the Name field, enter a suitable name for the new configuration. For example, HelloNeon.
  7. Click on the Connection tab to see the target and connection options.
  8. In the Select target panel:
    1. Select Android - Generic platform.
    2. Select Attach to a running Android application for the debug operation.
    3. Select the target in the Connections field.
    Figure 2-18 Typical Connection tab settings for an Android application
    Typical Connection tab settings for an Android application

  9. In the Files tab, click on Workspace... for the Project directory field and select the hello-neon directory. This automatically populates the other fields.
    Figure 2-19 Typical Files tab settings for an Android application
    Typical Files tab settings for an Android application

  10. Click on the Debugger tab and select Connect only in the Run control panel.
  11. In the Paths panel, click on Workspace... and select the hello-neon directory.
    Figure 2-20 Typical Debugger tab settings for an Android application
    Typical Debugger tab settings for an Android application

  12. Click on Debug to connect to the target.
  13. Debugging requires the DS-5 Debug perspective. If the Confirm Perspective Switch dialog box opens, click on Yes to switch perspective.
  14. To debug the application, set breakpoints, run, and step as required.

Note

If the application exits before NDK can attach gdbserver to the native library then you might need to add a delay before launching the Java native libraries.
Related tasks
2.11 Setting up the Android tools for use with DS-5
2.12 Loading the hello-neon application on to an Android target
Related information
DS-5 Knowledge Articles
Eclipse
Cygwin
Android Developers
Non-Confidential - BetaPDF file icon PDF versionARM DUI0478U
Copyright © 2010-2015 ARM. All rights reserved.