[Android]The connection to adb is down, and a severe error has occured.

在Android开发时,有时我们开启虚拟机运行程序时,会报类似以下错误:

[2015-07-19 15:08:29 - TestXiaoYanLibrary] The connection to adb is down, and a severe error has occured.
[2015-07-19 15:08:29 - TestXiaoYanLibrary] You must restart adb and Eclipse.
[2015-07-19 15:08:29 - TestXiaoYanLibrary] Please ensure that adb is correctly located at 'G:\eclipse\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe' and can be executed.

去百度了一下,可能是以下的情况:

a:模拟器不稳定,有时需要重新部署环境,甚至有时需要重新建立模拟器和新建个avd。

b:可能是默认端口被占用,在cmd中键入netstat查看,关掉有冲突的端口程序,或者设置新的端口。 

c:将platform-tools目录和tools目录加到Path环境变量中。 

d:将Eclipse进入DDMS模式,重启ADB 和Eclipse。

解决方案:

(1)一般情况都不需要太麻烦,直接切换到DDMS页面,选择reset adb即可。

[Android]The connection to adb is down, and a severe error has occured._第1张图片


(2)若经过第一个步骤,还是不行的话,执行一下操作:(在win7中的操作)

启动任务管理器-->进程页面-->寻找并选中adb.exe进程-->结束该进程-->再进行第一步的操作

[Android]The connection to adb is down, and a severe error has occured._第2张图片

(3)若发现虚拟机的状态不是在线(online),就把它关闭,重启打开,即可。

你可能感兴趣的:(eclipse,adb)