java - "Failed to attach to the remote VM"连接jdb到windows上的android模拟器

标签 java windows debugging android-emulator jdb

我一直在尝试将 jdb 连接到 android 模拟器一段时间,并且反复遇到:

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 位上运行。

最佳答案

目前这对我有用——创建套接字而不是共享内存连接。

>jdb –sourcepath .\src -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8700

在此之前,您需要进行一些设置——例如,查看这组 useful details on setting up a non-eclipse debugger .它包括一个设置初始断点的好技巧——在您的主目录中创建或编辑一个 jdb.ini 文件,其内容如下:

stop at com.mine.of.package.some.AClassIn:14

它们将被加载并延迟到连接。

编辑:忘记引用 Herong Yang's page .

关于java - "Failed to attach to the remote VM"连接jdb到windows上的android模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4220174/

相关文章:

java - NullPointerException,多维数组

java - 在 Java 源代码中使用 ASTParser 提取 Catch 子句

windows - 在 Windows 中更改符号链接(symbolic link)的目标

c - 使用winsock.h将整数转换为ipv4

javascript - P5 for 循环不停

java - android.view.ViewRootImpl$CalledFromWrongThreadException : Only the original thread that created a view hierarchy can touch its views

windows - 优化包含大量数据的 sqlite 数据库的技巧?

ruby-on-rails - 在 Ruby 中,如何编写一个方法来显示任何对象的实例变量名称及其值

iphone - 在 XCode 中对 iPhone 进行单元测试时控制台和调试器不工作

按钮上的php条件