Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line Breakpoints not suspending thread when debugging in Android Studio

I'm using android studio 1.5.1 and trying to debug a very simple application on an emulator. I've tried emulators with version 18-23 and all do the same thing. Basically it will suspend the thread for method level breakpoints but not for any line break points.

like image 468
R McCafferty Avatar asked Apr 04 '16 03:04

R McCafferty


People also ask

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

Does breakpoint stop all threads?

By default only the thread that hits the breakpoint stops. However, you can modify the behavior by changing the breakpopint properties. Save this answer.

Do breakpoints execute the line?

Breakpoints break before executing the line on which they are placed.

How do you use breakpoints in debugging?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.


1 Answers

If you are trying to debug multithread apps in Android Studio, you could have troubles with some of your breakpoints, so it's better to enable an Android Studio option to pause all threads by default setting.

Double click your breakpoint and make default the "Suspend All threads" option. enter image description here

like image 54
cesards Avatar answered Oct 26 '22 18:10

cesards