Ich habe versucht, jdb zu starten und versuchen, es an einen Prozess auf meinem Android-Gerät angeschlossen.jdb geben java.net.SocketException: Verbindung zurückgesetzt
Die Befehle, die ich versucht habe, sind wie folgt:
adb forward tcp:12345 jdwp:4127
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=12345
Wir diesen Prozess mit pid 4127 annehmen können, ist noch am Leben.
Nachdem jedoch die 2 Befehle eingegeben werden, erhielt ich die Fehlermeldung wie folgt:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:130)
at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:232)
at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:519)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:328)
at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)
Ich habe ein seltsames Verhalten bemerkt, dass dieser Ausgang tritt nur bei 1 meiner Anwendungen ausgeführt wird. Könnte das an einem Konflikt von Threads oder Prozessen oder Ports liegen, während das Programm läuft?
kann ich die folgende Ausgabe die meiste Zeit, wenn ich, dass bestimmte Anwendung geschlossen ist:
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> Input stream closed.
ich auch habe versucht, die Eingabeaufforderung im Administratormodus mit den folgenden Schritten ausgeführt wird:
netsh advfirewall set global StatefulFTP disable
adb forward tcp:12345 jdwp:4127
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=12345
Die Ausgabe ist wie folgt:
java.io.IOException: handshake failed - connection prematurally closed
at com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:136)
at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:232)
at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:519)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:328)
at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1066)
Fatal error:
Unable to attach to target VM.