您的位置:首页 > 运维架构 > Shell

adb 连不上设备的种种情况

2015-08-28 17:39 811 查看
1.通过usb连接线连接android设备,adb devices命令查询结果不显示设备

问题描述:adb工具版本 1.0.31;android手机usb调试已开启,usb驱动已正常安装。

豌豆荚打开后可以正常连接到手机,cmd命令adb device可以看到手机serialNumber,关闭豌豆荚设备就查询不到了

解决方法:
打开设备管理器--找到android驱动--打开--查询详细信息找到设备VID,譬如我的VID如下图为2B0E



C:\Documents and Settings\Administrator\.android 文件夹下打开adb_usb.ini文件(若没有就创建)。在里面添加一行 0x2B0E ,保存文件,重启adb。

=============================================================================================

adb shell error: device offline问题

可能原因

1.若是tcp链接,android设备的adbd监听模式未切换成tcp模式

先用usb线连接android设备,能正常识别:状态为device,

adb -s serial_numberxxx tcpip 5555

2.adb端口被占用

3.adb版本过低   http://my.oschina.net/jerikc/blog/345222
4.adb服务启动异常(重启服务)

adb kill-server

adb start-server

adb root

adb remount

5.adbd服务被关闭,重启adbd服务并重新设置端口号:

adb root

adb -s serial_numberxxx shell setprop service.adb.tcp.port 5555

adb -s serial_numberxxx shell start adbd

adb -s serial_numberxxx tcpip 5555

=============================================================================================

xp下排查adb端口是否被占用方法

1.adb nodaemon server

    查看adb服务是否启动并查看其端口号

2. netstat -ano|findstr "5037"

    列出TCP/IP连接(-a所有连接-n以数字形式-o列出进程号),并筛选出包含“5037”的行

    

2. 查看是哪个进程使用了5037端口

    tasklist|findstr “3028”

    

3.杀掉该进程

     taskkill /F /PID 1100

=================================================================================

eclipse连不上android设备

先重启adb:
http://jingyan.baidu.com/article/b0b63dbfddf3b34a4830700f.html
报错:

ADB server didn't ACK && make sure the plugin is properly configured

查错方法:
http://blog.csdn.net/houshunwei/article/details/9716927
我的原因是:adb端口被qq音乐占用了,打开管理器关掉tadb.exe即可

tips:adb默认端口为5037 , 使用详解如下
http://blog.sina.com.cn/s/blog_9d708b4f010155gp.html
小技巧:

hierarchy View显示不出android真机的时候  把手机上的usb调试关闭重启一次试试

==============================================================================

案例:

手机:三星note2 (android version 4.3)

OS:windows XP

问题描述:eclipse能连接成功,cmd命令连接不上(以上方法均尝试 还是报错error:device not found)

目前方法:
http://stackoverflow.com/questions/21408674/adb-error-device-not-found
1.手机USB连接方式从摄像头(PTP)模式媒体设备(MTP)模式,再切换回MTP

2.检查usb驱动是否安装正确:我的电脑--管理--设备管理器--Android Phone--Android Composite ADB Interface--右键-属性-驱动程序

(1)停止再重启(2)卸载再重装 均不行

目前没找到原因 待解决

      

===============================================================================

if you're having this same issue the problem is probably an out-of-date SDK. As of Android 4.2.2 there is a security feature that requires you to confirm the RSA fingerprint of the connecting device.  As the following screenshot:

Update ADB TOOL

1. Open the SDK manager and update the tools! Then reboot.

2. OR donwload the ADB from the link:
http://dl.vmall.com/c0b481awh1 http://pan.baidu.com/wap/album/file?uk=2265432600&album_id=153586529128231077&fsid=689995590
Confirm ADB VERSION

Use adb version to check your adb version, and you should work with adb version 1.0.31 and above.

If the version hint is still the old version after adb version command, you'd better check the adb.exe whether it's the old one under the path C:\Windows\System32
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Android shell