Android Debug -> Disconnected from the target VM - android

Suddenly it is not possible to debug my android device. After a few seconds the device disconnects and i get the following message: "Disconnected from the target VM, address: 'localhost:49504', transport: 'socket'
I am using a Zebra Scanner.
I didn't change the code since the last time that i worked on that app.
I deselected all breakpoints.
I tried different activites.
Even by just starting the app in debug mode, it disconnets after a few seconds.
Running the app and attatching the debugger has the same result.

Related

Android Studio debugger crashes/stops on breakpoint, when debugging on my Huawei phone

After the debugger reaches the breakpoint, the app process stops and after a little time (2-3 seconds) the debugger disconnect itself. But only if i debug with my Huawei phone (EMUI 10).
These are the last 3 lines from the log:
D/: [ZeroHung]zrhung_send_event: wp = 257, ret = 0
D/:[ZeroHung]zrhung_send_event: wp = 258, ret = 0
Disconnected from the target VM, address: 'localhost:8629', transport: 'socket'
If I debug the same app with the same breakpoint on an emulator, everything works fine. The debugger stops at the breakpoint, and doesn´t disconnect itself.
How did you build this project? If you build it with ant or other tools, make sure to compile with debugging information enabled (debug = true for ant javac tasks). Obfuscation and bytecode detection during construction can also affect the possibility of debugging. If you run it in some non-standard JVM, it can also cause such problems
When performing remote debugging, make sure to start the target process using the correct JVM options recommended in the IntelliJ idea remote debugging configuration. Your wrapper configuration may pass them incorrectly

Android Studio debugger does not stop at breakpoints for ADB over TCP

I am trying to debug my android application on a device connected via local-network.
I have used following instructions to create ADB with device over TCP:
Run/install/debug Android applications over Wi-Fi
I can install the app and see the logs but
i can not debug the application because Android studio doesn't stop at any breakpoint.
Following is Debug console's log:
Waiting for application to come online: com.example.tosc.notesync.test
| com.example.tosc.notesync
Connecting to com.example.tosc.notesync
Is it really possible to debug the android app line by line over wireless connection?

Android Debugger becomes detached

I am perplexed by the behavior of Android debugger using Android Studio. It just cuts out during my debug session, then device not available. I seem to also lose all logcat files when this happens so don't detect a crash. App does not crash either so ... I am trying to debug a WebView and its corresponding WebViewClient but in the middle of my debug session the debugger just dies. Then it says that no device found when I try to rebuild and run as debug session. I have to unplug and plug back in the USB cord. Only then if I am lucky does the device reappear. But usually debug session lasts just a little while and then cuts off.
adb kill-server
adb start-server
Does not help. Device is no longer available. What could be going on here? Debugging debugger is really tough
Here is what console says:
Uploading file to: /data/local/tmp/com.myapp.debug
java.io.IOException: An existing connection was forcibly closed by the remote host
If I then try to debug again I get:
Uploading file to: /data/local/tmp/com.myapp.debug
com.android.ddmlib.AdbCommandRejectedException: device 'b3941da' not found
I have had this happen on two Android devices a Galaxy III, and Note Android 4.03. Not sure whats going on here. I do see power saving mode some times kicks in on one of the devices ... Turned off power mode, but still see this happening quickly right after trying to load app.
When Debugger gets cut off why is my logcat also destroyed? I mean what's the thinking in doing that? I get one entry left everything else whipped out:
01-01 00:00:00.000 0-0/? E/Internal: device offline
To be frank that's kind of frustrating .....
Now I also see:
Connected to the target VM, address: 'localhost:8600', transport: 'socket'
Disconnected from the target VM, address: 'localhost:8600', transport: 'socket'

Can't Debug app in android studio

Im trying to debug a very simple app i wrote from the Udacity course.
when i run the app in debug mode the app launches on the device, Debugger connects as said in line 1, the message
"waiting for debugger" is shown on my phone for a second. But when that message is gone from phone the debugger is automatically disconnected (line 2).
1. Connected to the target VM, address: 'localhost:8604', transport: 'socket'
2. Disconnected from the target VM, address: 'localhost:8604', transport: 'socket'
I read other question people had here with this issue.
tried rebooting AS, my device, killing adb server and closing Bluestacks.
The only way i managed to debug apps is by pressing Attach debugger to android proccess while i manually opened the app from my phone.
Any ideas? i really need debug option to work properly.
EDIT: When i run the app in normal state i get this log:
7-07 19:57:06.253 22333-22390/com.example.android.justjava I/OpenGLRenderer﹕ Initialized EGL, version 1.4
07-07 19:57:06.258 22333-22390/com.example.android.justjava D/OpenGLRenderer﹕ Enabling debug mode 0
Why debug mode is in 0?
This isn't exactly an answer, since I never understood why it happened, but the same thing happened to me and I resolved it by restarting both my computer and my device, and it has not recurred since. Believe it or not I put up with this for almost a week before it occurred to me to restart my device.

Android Studio always disconnect immediately after beginning "debug"

Every time I try to debug any project with Android Studio, the app does not start, and immediately the console gives following message:
Connected to the target VM, address: 'localhost:8603', transport: 'socket'
Test running startedDisconnected from the target VM, address: 'localhost:8603', transport: 'socket'
I generally try to debug on my HTC Desire Z with Android 2.3.3 device and I remember that with Eclipse IDE the "debugging" works without any issues.
I finally solved it!
The problem was that at the left of start and debug button, the configuration menu was set to test. Just put it on App and now it works.

Categories

Resources