今天打开ecplise准备用手机调试android程序,突然报以下错误:
[2013-07-18 21:12:33 - adb]ADB server didn't ACK
[2013-07-18 21:12:33 - adb] * failed to start daemon *
[2013-07-18 21:12:44 - Android] ------------------------------
[2013-07-18 21:12:44 - Android] Android Launch!
[2013-07-18 21:12:44 - Android] The connection to adb is down, and a severe error has occured.
[2013-07-18 21:12:44 - Android] You must restart adb and Eclipse.
[2013-07-18 21:12:44 - Android] Please ensure that adb is correctly located at 'F:\Android\android-sdk-windows\platform-tools\adb.exe' and can be executed.
按提示关闭eclipse,手动重启adb server,却又报以下错误:
F:\Android\android-sdk-windows\platform-tools>adb kill-server
* server not running *
F:\Android\android-sdk-windows\platform-tools>adb start-server
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *
继续需找问题,看提示是adb 过期,但是我的adb是最新下载的,没理由。总之就是adb server 无法启动。
查看adb占用的端口发现无法绑定,可能是端口被占用.
F:\Android\android-sdk-windows\platform-tools>adb nodaemon server
cannot bind 'tcp:5037'
运行netstat命令查看 5037端口占用的程序
C:\Users\Roy_se7en>netstat -ano | findstr "5037"
TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 3064
查到是PID 为3064的程序占用端口
C:\Users\Roy_se7en>tasklist /FI "PID eq 3064"
映像名称 PID 会话名 会话# 内存使用
========================= ======== ================ =========== ============
wandoujia_daemon.exe 3064 Console 1 5,696 K
由上面可以看出 PID 3064的程序是豌豆荚软件。kill掉,eclipse可以正常调试.