Is there any way to breakpoint inside the tested c

2020-03-03 07:35发布

问题:

Here's my scenario:

  1. I have an Android service (CoreService)
  2. I use ServiceTestCase<CoreService> to test it
  3. CoreService spawns a thread and instantiates several classes that have listeners/callbacks on them.

Is there any way to set up breakpoints in the spawned threads and/or callbacks and have JUnit stop at these? It only stops at breakpoints set in the JUnit project or CoreService class.

回答1:

Try changing the breakpoint suspend policy to Suspend VM:

To change it globally:

For more information about Breakpoint Suspend Policy, check out here.