“无法连接到远程 VM"将 jdb 连接到 Windows 上的 android 模拟器

2023-06-27Java开发问题
12

本文介绍了“无法连接到远程 VM"将 jdb 连接到 Windows 上的 android 模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我一直在尝试将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 64bit 上运行.

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.

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

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

事先你需要做一些设置——例如,看这组 关于设置非 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.

忘记引用Herong Yang 的页面.

这篇关于“无法连接到远程 VM"将 jdb 连接到 Windows 上的 android 模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何使用 JAVA 向 COM PORT 发送数据?
How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)...
2024-08-25 Java开发问题
21

如何使报表页面方向更改为“rtl"?
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)...
2024-08-25 Java开发问题
19

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

有没有办法在 Java 中检测 RTL 语言?
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)...
2024-08-25 Java开发问题
11

如何在 Java 中从 DB 加载资源包消息?
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)...
2024-08-25 Java开发问题
13

如何更改 Java 中的默认语言环境设置以使其保持一致?
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)...
2024-08-25 Java开发问题
13