Android debugger constantly shuts down

I never had debugging problems in Android until I moved to the current workspace. This happens in both Eclipse and IntelliJ. I used to have a problem when the phone freezes in the "Wait to connect debugger" dialog box. Somehow I fixed this, so the debugger at least joins my application.

Now I can set a breakpoint and stop the debugger at that point. After about 5-10 seconds, it turns off no matter what I do. I can read several variable values ​​in memory before everything disappears. My colleague is able to debug the same application simply using Eclipse, and we were not able to figure out what was wrong or not between our workstations (except for me using IntelliJ). We can have different images for our laptops.

Any ideas? I had to use Log statements, but they are too slow compared to using the actual debugger. I tried using various USB cables, and that didn't really matter. I went through the debugger settings and nothing seemed unusual. Other Q / A on SO mentioned the application is quietly crashing, but I solve this because of its debugging for my colleague.

+12
source share
4 answers

I had the same problem running IntelliJ IDEA build IC-133.193. I solved the problem with the following actions:

  • Quit IntelliJ
  • From the command line, kill adb server with adb kill-server
  • Starting from running the adb server command as superuser with sudo adb start-server
  • Restart IntelliJ

IntelliJ will start the adb server if it detects that it is not running. When you start IntelliJ, the key starts adb as root.

[Refresh] This does not always work. The best solution I found was to run the application on the device, and then connect the debugger to the Android process through the Run menu. I had no shutdowns using this method.

+6
source

This is fixed for me.

  • Go to the "Power" section on your computer.
  • Click "Change plan setting" to the plan of your choice.
  • Click "Change advanced power setting" to your chosen plan.
  • Expand USB Settings.
  • Expand the "USB selective suspend setting" parameter and change it to disabled.
+2
source

This problem occurs when I try to use the USB 3.0 port. When using USB 2.0, this does not happen.

0
source

I fought adb for several days without seeing my device. After trying many other published solutions, I found that the problem was that Chrome was also trying to connect its debugger to the web view. If Chrome is connected using chrome: // inspect, then adb seems to be disconnecting. Exiting Chrome solves the problem. Then I can connect to Android Studio, and then restart Chrome and reconnect. Hope this helps someone else.

0
source

Source: https://habr.com/ru/post/956193/


All Articles