Android控制台:
[2012-06-27 10:58:14 - ChinaWeather] ------------------------------
[2012-06-27 10:58:14 - ChinaWeather] Android Launch!
[2012-06-27 10:58:14 - ChinaWeather] The connection to adb is down, and a severe error has occured.
[2012-06-27 10:58:14 - ChinaWeather] You must restart adb and Eclipse.
[2012-06-27 10:58:14 - ChinaWeather] Please ensure that adb is correctly located at 'D:\softDev\android-sdk-windows\platform-tools\adb.exe' and can be executed.
DDMS控制台:
[2012-06-27 10:58:16 - adb] ADB server didn't ACK
[2012-06-27 10:58:16 - adb] * failed to start daemon *
问题的表现:无法启动adb,之前调试的时候都是好好的,今天就没法用了。
在网上搜的结果:
1. 关闭eclipse,在taskmanager中找到adb,结束掉,重启eclipse
或者,关闭eclipse,在命令行输入:adb kill-server,重启eclipse
这种方案对我的情况无效,我在任务管理器里没有找到abd,它根本就没启动起来
2. 又找到几篇文章说,HTC的什么软件( HTC Sync )会占用adb运行的端口5037,使adb无法运行,我倒是没有装过HTC,不过最近装了豌豆荚
看了下系统启动选项,豌豆荚居然加了一个***-help的东西随系统启动,在任务管理器中结束掉,同时结束掉所有wandoujia的进程,重启eclipse
运行程序,run android application,控制台还是打印错误信息
The connection to adb is down, and a severe error has occured.
……
不过,这次DDMS没有错误信息了,这么说wandoujia是有影响的,看了下任务管理器,有adb进程,可是为什么还是连不到呢。
在命令行输入 adb kill-server试试,
输完后,DDMS的控制台有打印:
[2012-06-27 11:32:06 - DeviceMonitor] Adb connection Error:远程主机强迫关闭了一个现有的连接。
[2012-06-27 11:32:08 - DeviceMonitor] Connection attempts: 1
[2012-06-27 11:32:10 - DeviceMonitor] Connection attempts: 2
[2012-06-27 11:32:12 - DeviceMonitor] Connection attempts: 3
……
有反应, 在命令行继续输入: adb start-server
DDMS控制台停止打印
再次运行程序,没有错误信息,貌似成功了……
结论: adb的运行端口被占用,无法启动,我的环境里是豌豆荚的进程占用了端口,结束掉占用端口的进程,重启eclipse,重启adb。