以下都是adb连接问题,可以通过尝试如下步骤,由简单度排序
1. 插拔下usb连接线
2. 关闭usb模式再打开
3. 执行以下命令
adb kill-server
adb start-server
4. 效果与3相同
ddms - devices - reset adb
5. 关闭所有pc套件,例如:
杀死 wandoujia 相关的所有进程,ok
wandoujia_daemon.exe
wandoujia_helper.exe
6. 重启eclipse
7. 查看有几个adb进程,全部杀死再重新启动adb
8. 查看下usb先是否连接电脑与手机
9. 重启手机
10. 关闭占用5037端口软件
11. 更新adb (见问题14)
1. 查看占用端口5037的pid值
netstat -a -n -o |findstr "5037"
输出结果:
tcp 127.0.0.1:5037 0.0.0.0:0 listening 5096
tcp 127.0.0.1:5037 127.0.0.1:51577 established 5096
tcp 127.0.0.1:51577 127.0.0.1:5037 established 4324
2. 从上面得知pid = 5096占用了5037端口,现在通过pid查看进程名,看到底哪个进程占用此端口
tasklist /v | findstr 5096
tadb.exe 5096 console 1 4,932 k unknown ...... 0:00:02 暂缺
网上查询得知tadb.exe是腾讯管家启动的进程
3. 杀死占用5037端口的进程 tadb.exe
taskkill /f -pid 5096
taskkill /im tadb.exe
输出结果
成功: 已终止 pid 为 5096 的进程。
问题1
the connection to adb is down, and a severe error has occured.
you must restart adb and eclipse.
please ensure that adb is correctly located at 'adb.exe' and can be executed.
问题2
adb server didn't ack
* failed to start daemon *
问题3
adb failed to restart! make sure the plugin is properly configured
问题4
** adb connection error:远程主机强迫关闭了一个现有的连接
问题5
java.io.ioexception: 您的主机中的软件中止了一个已建立的连接。
at sun.nio.ch.socketdispatcher.write0(native method)
at sun.nio.ch.socketdispatcher.write(unknown source)
at sun.nio.ch.ioutil.writefromnativebuffer(unknown source)
at sun.nio.ch.ioutil.write(unknown source)
at sun.nio.ch.socketchannelimpl.write(unknown source)
at com.android.ddmlib.jdwppacket.writeandconsume(jdwppacket.java:213)
at com.android.ddmlib.client.sendandconsume(client.java:575)
at com.android.ddmlib.handleheap.sendreaq(handleheap.java:348)
at com.android.ddmlib.client.requestallocationstatus(client.java:421)
at com.android.ddmlib.devicemonitor.createclient(devicemonitor.java:854)
at com.android.ddmlib.devicemonitor.openclient(devicemonitor.java:822)
at com.android.ddmlib.devicemonitor.processincomingjdwpdata(devicemonitor.java:781)
at com.android.ddmlib.devicemonitor.deviceclientmonitorloop(devicemonitor.java:649)
at com.android.ddmlib.devicemonitor.access$100(devicemonitor.java:42)
at com.android.ddmlib.devicemonitor$3.run(devicemonitor.java:577)
通常是同时打开了两个eclipse,关闭一个即可
问题6
failed to install .apk on device '': unable to open sync connection!
java.io.ioexception: unable to open sync connection!
launch canceled!
问题7
adb rejected shell command (rm /data/local/.apk): closed
error during sync: unable to open sync connection!
adb connection error:远程主机强迫关闭了一个现有的连接。
connection attempts: 1
connection attempts: 2
connection attempts: 3
问题8
failed to install .apk on device : too many open files
com.android.ddmlib.syncexception: too many open files
launch failed on device:
问题9
failed to install .apk on device '': closed
com.android.ddmlib.installexception: closed
launch failed on device:
问题10
installation error: install_failed_insufficient_storage
please check logcat output for more details.
问题11
installation error: install_failed_update_incompatible
使用pc套件删除,然后安装不行,通过adb uninstall 再次删除,安装ok
问题12
android launch!
connection with adb was interrupted.
0 attempts have been made to reconnect.
you may want to manually restart adb from the devices view.
问题13
unexpected error while launching logcat. try reselecting the device.] closed
om.android.ddmlib.adbcommandrejectedexception: closed
at com.android.ddmlib.adbhelper.executeremotecommand(adbhelper.java:381)
at com.android.ddmlib.device.executeshellcommand(device.java:462)
at com.android.ddmuilib.logcat.logcatreceiver$1.run(logcatreceiver.java:109)
at java.lang.thread.run(unknown source)
问题14
adb server is out of date. killing...
* daemon started successfully *
error: device offline
出现问题的版本
d:\>adb version
android debug bridge version 1.0.29
问题出在adb的版本太低,更新adt后问题解决
android debug bridge version 1.0.31
2013-03-21 更新问题6,问题7
2013-04-18 更新问题8,9,10,11,12。统一解决方案
2014-01-27 更新error: device offline 问题与解决方案
今天我在运行项目的时候发现自己的手机连不上eclipse,进入ddms,adb reset之后出现了如下提示:
出现这个错误的原因是因为电脑上的各种手机助手抢占了手机链接,用自己的adb进程启动,导致我们开发用的sdk abd无法启动。
知道原因后,解决办法就是手动在任务管理其中将各种手机助手的进程关闭(仅仅关闭退出他们的软件是不行的,必须杀掉他们的进程才可以的)。我们可以右键点击window下面的任务栏,然后选择“启动任务管理器”,然后在任务管理器中找到响应手机助手的进程,我的电脑上面装的是金山的手机助手,它的进程是:tadb.exe
选中并结束这个进程即可
最后我们在eclipse的ddms中重新reset adb即可使手机连接上eclipse,over~