Attach to running app #75

Closed
opened 2025-08-09 17:13:15 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @adelphes on 4/22/2020

Add new launch configuration to allow the debugger to connect to debuggable apps and Java processes running on the device.

The default configuration uses a processId value of "${command:PickAndroidProcess}" to automicatically invoke a new extension command to list debuggable processes running on the connected device.

  • The attach launch config requires the appSrcRoot in order to identify breakpoint locations.
  • To ensure all breakpoints are loaded after attaching, a list of all currently loaded classes is now retrieved upon connection.
  • VSCode quick-pick lists are used to select which device (if there's more than one) and which process should be attached to.
  • The adb jdwp command never terminates - we use a timeout value to limit how long we search for debuggable processes.
  • Retrieving the package names of the PIDs uses a shell for loop which requires multiple socket reads to obtain all of the output. A new untilclosed flag has been added to the socket functions to allow this, which keeps reading from the socket until the other side closes it.
*Originally created by @adelphes on 4/22/2020* Add new launch configuration to allow the debugger to connect to debuggable apps and Java processes running on the device. The default configuration uses a processId value of `"${command:PickAndroidProcess}"` to automicatically invoke a new extension command to list debuggable processes running on the connected device. - The attach launch config requires the `appSrcRoot` in order to identify breakpoint locations. - To ensure all breakpoints are loaded after attaching, a list of all currently loaded classes is now retrieved upon connection. - VSCode quick-pick lists are used to select which device (if there's more than one) and which process should be attached to. - The `adb jdwp` command never terminates - we use a timeout value to limit how long we search for debuggable processes. - Retrieving the package names of the PIDs uses a shell for loop which requires multiple socket reads to obtain all of the output. A new `untilclosed` flag has been added to the socket functions to allow this, which keeps reading from the socket until the other side closes it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/android-dev-ext#75
No description provided.