消除ADB错误“more than one device and emulator”的方法
2021-07-15 15:16:17    525    0    0
admin

消除ADB错误“more than one device and emulator”的方法

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

  1. C:\Users\gaojs>adb shell
  2. error: more than one device and emulator
  3. C:\Users\gaojs>adb install e:\good.apk
  4. error: more than one device and emulator

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

  1. C:\Users\gaojs>adb devices
  2. List of devices attached
  3. emulator-5554 device
  4. 4dfadcb86b00cf05 device

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

  1. C:\Users\gaojs>adb -s emulator-5554 shell

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

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

  1. C:\Users\gaojs>adb kill-server
  2. C:\Users\gaojs>taskkill /f /im adb.exe

第一条命令是杀ADB的服务,第二条命令是杀ADB的进程!
如果第一条没有用,才考虑用第二条命令再试试看的!

Prev: [参考]彻底解决Golang获取当前项目绝对路径问题

Next: 如何用adb命令卸载系统自带应用adb免root修改系统文件的方法

525
Table of content