Android开发:命令行中的ddms看不到设备
===============================
*已解决 *:请参阅下面的答案
我不想使用 Eclipse。
从命令行:
模拟器正在运行。 adb 服务器正在运行。 “adb devices”正确列出,我可以在输出中的 avd 上看到我的实例。
但是,当我从命令行手动启动 DDMS 时,它只是不断尝试连接。我找不到连接配置问题。
任何建议(除了“使用 Eclipse”)非常欢迎!
(是的,它在 eclipse 中工作,ddms 显示线程等)
系统:Debian Squeeze
更新:我运行 update-java-alternatives 以确保 java 已正确设置为“Java(TM) SE 运行时环境(构建 1.6.0_20-)” b02)”。对于经验丰富的 Debian 用户来说,这并不奇怪,我的 Java 现在更糟了……当我从命令行运行 ddms 时,我得到:--
(ddms:9326): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
04:29 E/ddms: Failed to reopen debug port for Selected Client to: 8700
04:29 E/ddms: Invalid argument
java.net.SocketException: Invalid argument
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at com.android.ddmlib.MonitorThread.reopenDebugSelectedPort(MonitorThread.java:716)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:226)
04:29 E/DeviceMonitor: Connection attempts: 1
04:30 E/DeviceMonitor: Connection attempts: 2
04:31 E/DeviceMonitor: Connection attempts: 3
04:32 E/DeviceMonitor: Connection attempts: 4
04:33 E/DeviceMonitor: Connection attempts: 5
04:34 E/DeviceMonitor: Connection attempts: 6
===============================
*SOLVED * : see answer below
I dont want to use Eclipse.
From the command line:
An emulator is running. adb server is running. "adb devices" lists correctly and I can see my instance on an avd in the output.
However when I manually start DDMS from the command line it just keeps trying to connect. I can find no connection config issues.
Any suggestions (other than "use Eclipse") most welcome!
(yes, it works from within eclipse and ddms shows threads etc)
System : Debian Squeeze
Update : I ran update-java-alternatives to be sure java was set up properly for "Java(TM) SE Runtime Environment (build 1.6.0_20-b02)" . Not too much of a surprise to seasoned Debian users my Java is now worse ... When I run ddms from the command line I get :--
(ddms:9326): Gdk-WARNING **: gdk_window_set_icon_list: icons too large
04:29 E/ddms: Failed to reopen debug port for Selected Client to: 8700
04:29 E/ddms: Invalid argument
java.net.SocketException: Invalid argument
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at com.android.ddmlib.MonitorThread.reopenDebugSelectedPort(MonitorThread.java:716)
at com.android.ddmlib.MonitorThread.run(MonitorThread.java:226)
04:29 E/DeviceMonitor: Connection attempts: 1
04:30 E/DeviceMonitor: Connection attempts: 2
04:31 E/DeviceMonitor: Connection attempts: 3
04:32 E/DeviceMonitor: Connection attempts: 4
04:33 E/DeviceMonitor: Connection attempts: 5
04:34 E/DeviceMonitor: Connection attempts: 6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 Debian 中,解决方案是强制 java 使用 IPv4。
/etc/sysctl.d/bindv6only.conf
然后从 bash
另请参阅 Debian 错误报告 了解更多详细信息。
The solution is, in Debian, to force java to use IPv4.
/etc/sysctl.d/bindv6only.conf
And then from bash
Also see the Debian bug report for more details.
在 eclipse.ini 中的某处添加这一行对我有帮助:
指令名称不言而喻。
Adding this line somewhere in eclipse.ini helped me:
The directive name speaks for itself.
我也遇到过这个问题。我总是发现,如果在连接设备、运行模拟器或启动 ddms 之前先关闭 eclipse,一切都会正常工作。
我认为 Eclipse SDK 占用了连接并阻止 ddms 访问设备或模拟器。
I've had this problem too. I've always found that if you close eclipse first before connecting the device, running an emulator, or starting ddms, everything works just fine.
I think the Eclipse SDK hogs the connection and prevents ddms from accessing the device or emulator.
IPv4 对我来说不起作用,但将设备插入不同的 USB 端口解决了这个问题(通过 Android 设备未显示在 DDMS 中)
The IPv4 did not work for me, but plugging the device on a different USB port solved this issue (via Android device not showing up in DDMS)