Debug by attaching to a process


If you're connecting to your target machine by IP, you can use the BlackBerry Attach to Running Application configuration to connect to a remote process that's already running.

Before you begin:

Your application must already be running on the device or simulator to attach to its process. Also, ensure that either the device or simulator that you want to use is in Development mode.

To enable Development Mode if it is not currently set:

  1. Connect to the device.
  2. On the home screen, swipe down from the top of the screen.
  3. Tap Settings > Security and Privacy > Development Mode.
  4. Tap the Use Development Mode toggle switch.
  5. If prompted, type the password for your device, and tap OK.
To debug an application by attaching to a process:
  1. Select a project from the Project Explorer.
  2. Right-click on the project and select the Device-Debug variant from Build Configurations > Set Active > Device-Debug.
  3. Optional: Navigate to some statements in your code, such as in main.c, that you can add breakpoints to.
  4. Right-click on the project from the Project Explorer and click Build Project.
  5. Right-click on the project and select Debug As > Debug Configurations.
  6. Create a debug launch configuration of type BlackBerry Attach to Running Application by selecting the type and then clicking New.
  7. Click Debug to start the debug process.
  8. In the Select Process Verify dialog, select a running process.
    The debug session starts.
  9. In Debug view, click Resume.
    Verify that the application is running.
  10. If you specified one or more breakpoints earlier, the IDE should encounter a breakpoint.
  11. Verify that the IDE encountered the breakpoint.
  12. Click Resume to continue debugging.
  13. Click Disconnect.
    The debug session is terminated but the process continues to run.

Last modified: 2013-12-21

comments powered by Disqus