adb被占用解决办法

方案一:

近日在MyEclipse里面运行Android的应用,总是报错误信息,Adb connection Error:An existingconnection was forcibly closed by the remotehost,主要的内容大概是如此了。然后到ADT的对应的目录下面,adb.exe文件安好,这就奇怪了。今天,上网Google了一下,发现了问题所在,是模拟器出问题了。于是乎,重启模拟服务。


打开命令行界面(CMD),管理员的用户打开(Win7)的系统。然后在命令行的界面进入adb.exe的安装目录。如果ADT安装在c盘的andriod的目录,那么,在CMD的界面,需要cd进入目录:
C:\Android\ADT\adt-bundle-windows-x86_64\sdk\platform-tools.

然后执行:adb kill-server,中断当前的进程服务;
然后再执行: adb start-server, 重启服务。

当看到界面上显示:
* daemonnot running.starting it now on port 5037* 
* daemon startedsuccessfully *

说明服务重启成功。这个时候,再去运行Android的应用程序,Okay了,就出现一个模拟的手机界面了。搞定。

方案二:

adb server is out of date.  killing...
ADB server didn't ACK
* failed to start daemon *
error: unknown host service

 

使用adb时,若出上面的错,使用adb kill-server是没有用的,因为此时是其他进程的监听了端口,而不是adb。我用cmd+命令管理器解决:

输入netstat -ano | findstr "5037"  

找到下列进程

  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       4236  

  TCP    127.0.0.1:5037         127.0.0.1:49422        ESTABLISHED     4236  

  TCP    127.0.0.1:49422        127.0.0.1:5037         ESTABLISHED     3840 

此时把4236这个进程结束就行了。

TASKLIST | findstr "4236"

我的是被一个叫tadb.exe的挟持了,貌似是qqmusic的进程,结束它,over


方案三:

Looks like the installed driver was in bad state. Here is what I did to make it work:

    Delete the device from Device Manager.
    Rescan for hardware changes.
    "Slate 21" will show up with "Unknown driver" status.
    Click on "Update Driver" and select /extras/google/usb_driver
    Device Manager will find the driver and warn you about installing it. Select "Yes."

This time the device got installed properly.

Note that I didn't have to modify winusb.inf file or update any other driver.

Hope this helps.

http://stackoverflow.com/questions/7411295/error-adb-connection-erroran-existing-connection-was-forcibly-closed-by-the-r

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值