Android開發問題記錄——“The connection to adb is down…”

來源:互聯網
上載者:User

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。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.