输入adb shell 时 提示error: more than one device and emulator

当我连着手机充电的时候,启动模拟器调试,执行ADB指令时,报错。

C:\android\android-sdk\platform-tools>adb shell
error: more than one device and emulator
C:\android\android-sdk\platform-tools>adb install e:\good.apk
error: more than one device and emulator

碰到这种情况,首先要查一下,是不是真的有多个设备或模拟器。

C:\android\android-sdk\platform-tools>adb devices
List of devices attached
192.168.141.101:5555  device
4dfadcb86b00cf05        device

发现还真是多个设备,那就需要为ADB命令指定设备的序列号了。

C:\android\android-sdk\platform-tools>adb -s 192.168.141.101:5555 shell

也就是如上所示,给命令加上-s的参数就可以了!

或者我把连着的手机从电脑上移除,就可以了。嘿嘿~~~

如果实际上只有一个设备或模拟器,并且查到有offline的状态;
那就说明是ADB本身的BUG所导致的,就需要用如下的方法处理下了:

C:\android\android-sdk\platform-tools>adb kill-server
C:\android\android-sdk\platform-tools>taskkill /f /im adb.exe

第一条命令是杀ADB的服务,第二条命令是杀ADB的进程!

如果第一条没有用,才考虑用第二条命令再试试看的!

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...