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

解决方法:

在Debian中,解决方案是强制java使用IPv4.

/etc/sysctl.d/bindv6only.conf

net.ipv6.bindv6only = 0

然后从bash

sudo invoke-rc.d procps restart

有关更多详细信息,请参阅Debian bug report.

上一篇:Android附加调试器而不运行应用程序


下一篇:在Mac上的Android模拟器中收到了错误的纬度/经度