Ubuntu使用Eclipse开发Android报错:The connection to adb is down, and a severe error has occured.
问题描述:
在给Ubuntu安装开发Android 的adt-Eclipse时,安装完成之后,重新创建了一个项目之后,运行时报错:具体报错信息如下:
The connection to adb is down, and a severe error has occured.
[2013-09-06 09:36:56 - HelloOPone] You must restart adb and Eclipse.
[2010-09-01 09:36:56 - HelloOPone] Please ensure that adb is correctly located at '/home/Program/PAccess/Sdk/platform-tools' and can be executed.
解决方案
遇到这种问题之后,我第一时间找到网上寻求帮助。
网上大多的解决方案是这样的:
先开启任务管理器,
关掉已存在的adb程序,
在sdk下的platform-tools下执行命令:
adb kill-server
之后在实行adb server
还有一种方法说的是:
在命令行窗口输入:netstat -ato
命令查看占用5037端口的程序是哪个,使用kill -9 程序PID
干掉他,然后再重启adb就可以了。
如果上面的方法还是解决不了问题,那么可能是因为系统有个默认自启的adb。可以通命令查看该自启动的adb的pid。
snowlive@snowlive:~$ ps -ef |grep adb
501 1685 1 0 9:35上午 ?? 0:00.32 adb -L tcp:5037 fork-server server --reply-fd 4
501 1804 913 0 9:36上午 ttys000 0:00.00 grep adb
第二个参数就是改程序的pid。
显然,是默认自启程序是adb -L,关闭方式为,在命令行输入:
sudo kill -9 adb对应PID
命令。在上面的例子中,adb对应的PId为1685。所以结束上面的程序的命令是sudo kill -9 1685
。
如此问题解决。