`
兩ting
  • 浏览: 76226 次
  • 性别: Icon_minigender_2
  • 来自: 成都
社区版块
存档分类
最新评论

DeviceMonitor Adb connection Error:远程主机强迫关闭了一个现有的连接 解决方法

阅读更多

本文主要解决adb connection error的问题——reset adb.

 

环境为真机测试,偶尔会报如下错误

Java代码  收藏代码
  1. [2012-04-24 20:41:34 - DeviceMonitor]Adb connection Error:远程主机强迫关闭了一个现有的连接。  
  2. [2012-04-24 20:41:36 - DeviceMonitor]Connection attempts: 1  
  3. [2012-04-24 20:41:38 - DeviceMonitor]Connection attempts: 2  
  4. [2012-04-24 20:41:40 - DeviceMonitor]Connection attempts: 3  
  5. [2012-04-24 20:41:42 - DeviceMonitor]Connection attempts: 4  
  6. [2012-04-24 20:41:44 - DeviceMonitor]Connection attempts: 5  
  7. [2012-04-24 20:41:46 - DeviceMonitor]Connection attempts: 6  
  8. [2012-04-24 20:41:48 - DeviceMonitor]Connection attempts: 7  
  9. [2012-04-24 20:41:50 - DeviceMonitor]Connection attempts: 8  
  10. [2012-04-24 20:41:52 - DeviceMonitor]Connection attempts: 9  
  11. [2012-04-24 20:41:54 - DeviceMonitor]Connection attempts: 10  
  12. [2012-04-24 20:41:56 - DeviceMonitor]Connection attempts: 11  
  13. [2012-04-24 20:44:06 - ddms]ADB rejected shell command (ls -l /): closed  
  14. [2012-04-24 20:44:11 - ddms]ADB rejected shell command (ls -l /): closed  

之前都是重启eclipse解决,但偶尔还解决不了。对于真机需要拔掉数据线,关闭eclipse重启,重新连接手机解决。 

 

但由于eclipse实在过于笨重,关闭重启时间过长。找到另外一种解决方法:

eclipse中视图模式选择DDMS(还有常见的java和debug视图), 显示Devices窗口,若无可通过选择window->show view->Devices显示,再选择下拉箭头中的reset adb

此时eclipse会再自动重试一次,输入Connection attempts:1即表示成功啦

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics