问题描述
我一直在试图JDB连接到Android模拟器了一小会儿,并已与多次会见:
I’ve been trying to connect jdb to the android emulator for a little while, and have been met repeatedly with:
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.
没有那么大。是什么让这一轮的最好方法?我运行在Windows 7 64位。
Not so great. What's the best way of getting round this? I'm running on Windows 7 64bit.
推荐答案
目前这是为我工作 - 做一个插座,而不是共享内存连接
Currently this is working for me -- making a socket rather than a shared memory connection.
>加多宝-sourcepath的\\ src -connect com.sun.jdi.SocketAttach:主机名=本地主机,端口= 8700
>jdb –sourcepath .\src -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8700
在此之前你需要做一些设置 - 例如,看到这组useful关于建立非Eclipse调试器细节。它包括一个很好的提示设置你的初始断点 - 创建或编辑你的主目录下的文件jdb.ini与内容,如:
Beforehand you need to do some setup -- for example, see this set of useful details on setting up a non-eclipse debugger. It includes a good tip for setting your initial breakpoint -- create or edit a jdb.ini file in your home directory, with content like:
stop at com.mine.of.package.some.AClassIn:14
,他们会得到加载,并推迟到连接。
and they'll get loaded and deferred until connection.
编辑:忘了参考
这篇关于"无法连接到远程VM" JDB连接到Windows上的Android模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!