經常遇到 Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be executed.

遇到問題描述:

執行android程式控制臺輸出

[2012-07-18 16:18:26 - ] The connection to adb is down, and a severe error has occured.
[2012-07-18 16:18:26 - ] You must restart adb and Eclipse.
[2012-07-18 16:18:26 - ] Please ensure that adb is correctly located at 'D:\java\sdk\platform-tools\adb.exe' and can be executed.

解決問題:

百度google大家多說的是工作管理員 kill掉adb 或者重啟adb server,但我工作管理員就沒有adb ,猜測是某個程式佔用了adb埠。於是按此思路查詢。

5037為adb預設埠 檢視該埠情況如下:

netstat -aon|findstr "5037"

TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 6540

發現6540佔用了 5037埠,繼續檢視6540的task,發現是wandoujia .如下所示

tasklist|findstr "6540"

wandoujia_daemon.exe 6540 Console 1 4,276 K

接下來問題就好解決了,在工作管理員kill掉wandoujia_daemon.exe ,執行android程式,ok .

1.關閉豌豆莢程序

2.adb kill-server

3.adb start-server

4.重啟Eclipse

OK

如何操作 adb kill-server和adb start-server

cmd視窗

1、開啟cmd視窗,進入adb.exe所在的資料夾目錄,(adb是android中的一個很有用的工具,用來檢視android虛擬機器中內容,並進行相應操作),因為我的android-sdk-windows是放在D盤上,所以要先進入D盤,直接輸入D:

如圖所示就可以直接進入D盤了,再輸入cd android-sdk-windows\platform-tools 從而進入了adb.exe所在的目錄。