运行第一个新建工程:The connection to adb is down, and a severe error has occured.

新建的android空白工程执行时报错

  1. The connection to adb is down, and a severe error has occured.   
  2. You must restart adb and Eclipse.   
  3. Please ensure that adb is correctly located at 'D:androidplatform-toolsadb.exe' and can be executed.  

解决办法:

  1. 首先,按照提示到相关路径下,查找看相应的文件是否在那个目录下。
  2. 然后,重新启动eclipse和adb。

重启adb:

  • 在命令行下cd到D:androidplatform-tools目录,执行:adb kill-server命令;
  • 然后再执行adb start-server命令。

成功出现以下信息:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *

此时可以重启eclipse,run as一下。

 

 


失败出现以下信息:

 

 

    * daemon not running. starting it now *   

 

    ADB server didn't ACK   

 

    * failed to start daemon *   

 

此时可能是端口占用的问题,以下解决步骤: 

  1. 在命令行界面输入命令:netstat -ano|find "5037"(adb所用端口是5037,启动失败可能是其他程序占用此端口);

    

  红框内是进程的id就是PID

  2. 然后打开任务管理器-->查看-->选择列-->PID(进程标示符),打钩,确定,找到相应的进程,结束掉然后再重启eclipse,run as即可。

    

原文地址:https://www.cnblogs.com/llhua/p/3351363.html