我正在尝试调试 SipDemo SDK 示例。但是,DDMS 无法连接到模拟器上运行的应用程序(Android 4.0 API 级别 14)。模拟器等待调试,eclipse调试器无法打开端口。此外,ddms 报告 VM 调试端口无法打开。
确认以下,
- 端口未被使用
- ADB Server/Eclipse/Machine 已重新启动
- 主机文件检查 127.0.0.1
- 检查首选项以选择 127.0.0.1 作为 ADBHOST
- 为 Android 4.0 选择了合适的 VM
- 使用 Comodo 防火墙,所以在禁用防火墙后尝试调试。
应用程序期望的端口与调试器正在使用的端口存在差异。一个用于 Android 操作系统,一个用于运行 IDE 的实际主机?
图像和日志
设备处理窗口
http://imageshack.us/photo/my-images/94/androiddebugging.png
VM 调试端口错误(在 Eclipse 启动时)
http://imageshack.us/photo/my-images/820/vmdebugport8700.png
LogCat 视图
05-16 14:46:20.547: W/ActivityThread(1094): Application com.example.android.sip is waiting for the debugger on port 8100...
安慰
[2012-05-16 10:46:17 - SipDemo] Android Launch!
[2012-05-16 10:46:17 - SipDemo] adb is running normally.
[2012-05-16 10:46:17 - SipDemo] Performing com.example.android.sip.WalkieTalkieActivity activity launch
[2012-05-16 10:46:17 - SipDemo] Automatic Target Mode: Preferred AVD 'Android40' is available on emulator 'emulator-5554'
[2012-05-16 10:46:18 - SipDemo] Application already deployed. No need to reinstall.
[2012-05-16 10:46:18 - SipDemo] Starting activity com.example.android.sip.WalkieTalkieActivity on device emulator-5554
[2012-05-16 10:46:20 - SipDemo] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.sip/.WalkieTalkieActivity }
[2012-05-16 10:46:20 - SipDemo] Attempting to connect debugger to 'com.example.android.sip' on port 8630
[2012-05-16 10:46:40 - SipDemo] Launch error: Failed to connect to remote VM. Connection timed out.