Android app runs very slowly after resuming from breakpoint

1.3k views Asked by At

My Android app runs dead slow (almost frozen) after resuming from a Java breakpoint, even if I disconnect from the debugger or even unplug the USB cable. I get the same behavior on every device and emulator I've tried. Performance is great until it hits the first breakpoint, but it's unusable after I resume and I have to kill it. It's very frustrating.

It used to work great but it started with Android Studio 3.1.x and it's still happening after I upgraded to 3.2.1, then 3.3.2, the latest stable release at this time. None of my colleagues who work on the same app have this problem so it's probably not the code. I suspect I have a configuration issue somewhere.

I have no idea what changed when it started. It happens no matter where the breakpoint is. I don't see any errors in LogCat.

I'm using a MacBook Pro (15-inch, 2017) running OSX 10.13.6, Android Studio 3.3.2 (current stable release) and a Pixel XL running P. Also various emulators running P.

Any ideas or suggestions are much appreciated.

NOTE: It happens on Java breakpoints but not Kotlin.

NOTE: I cannot repro with a simple default app, so it's project specific, but only on my machine.

4

There are 4 answers

1
shubhamgarg1 On

Try to remove all the previous breakpoints that you might have added in Android Studio.

Go to the debugger window and select the View Breakpoints option and then disable all the old breakpoints and only add the new one which you want to use.

Debugger section

Disable all old breakpoints

1
ROCFER On

enter image description here

make sure your debugger is ok .

0
Magudesh On

Don't add breakpoint in the method definition. Method breakpoint will decrese the performance. Go with line breakpoint. That is better.

Please go through the difference b/w method breakpoint and line breakpoint if you are not aware.

0
TIMBLOCKER On

As @Magudesh stated, method breakpoints are very slow for the android debugger.

It's a lot more useful to just add a line breakpoint in the first line of your method and then (if it's necessary) in the last line.

That will greatly increase performance. If you then want to jump to the next breakpoint you can just hit the green play button in your debugger window.