Ho cercato di collegare JDB per l'emulatore di Android per un po ', e sono state soddisfatte ripetutamente con:"Impossibile connettersi al VM remoto" che collega JDB per l'emulatore di Android su Windows
jdb -sourcepath ./src -attach localhost:8700 java.io.IOException: shmemBase_attach failed: The system cannot find the file specified at com.sun.tools.jdi.SharedMemoryTransportService.attach0(Native Method) at com.sun.tools.jdi.SharedMemoryTransportService.attach(SharedMemoryTransportService.java:90) at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:98) at com.sun.tools.jdi.SharedMemoryAttachingConnector.attach(SharedMemoryAttachingConnector.java:45) at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:358) at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:168) at com.sun.tools.example.debug.tty.Env.init(Env.java:64) at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1010) Fatal error: Unable to attach to target VM.
Non così eccezionale. Qual è il modo migliore per aggirare questo? Sono in esecuzione su Windows 7 a 64 bit.
È possibile connettersi tramite il debugger? [Controlla la mia risposta qui] (http://stackoverflow.com/questions/4199323/android-app-not-launching-on-emulator/4199575#4199575) –
Hm, sembra che le voci nel mio file hosts siano tutte commentate fuori, dicendo: # la risoluzione dei nomi localhost viene gestita all'interno del DNS stesso. # \t 127.0.0.1 localhost # \t :: 1 localhost –
Trovato * una * risposta. Da alcuni googling sembra che jdb su Windows passi automaticamente a una connessione di memoria condivisa con una VM remota (http://www.herongyang.com/jtool/jdb_3.html). Si scopre che siamo in grado di specificare un diverso tipo di connessione: > JDB -connect com.sun.jdi.SocketAttach: hostname = localhost, port = 8700 Impostare uncaught java.lang.Throwable Imposta differita non rilevata java.lang.Throwable Inizializzazione jdb ... > Questo sembra collegarsi, almeno. –