adb.exe: error: more than one device/emulator
执行adb.exe -P 5037 -s 192.168.137.103:5555 forward tcp:19570 tcp:6790,提示 more than one device/emulator
背景
os:window10
adb 版本:
C:\Users\lnz>adb --version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as D:\Program Files (x86)\appium\sdk\platform-tools\adb.exe
注意我的Android SDK platform-tools 是Version 30.0.4-6686687
开启了2个模拟器
C:\Users\lnz>adb devices
List of devices attached
192.168.137.102:5555 device
192.168.137.103:5555 device
解决方案
- 把Android SDK platform-tools 的版本由30 降级为29;
具体操作:
-
打开sdk manager
-
为了降级为29版本,需要先把30版本的 Android SDK platform-tools 进行删除操作
-
删除30版本Android SDK platform-tools 后 29版本就出现,选择29版本的 进行安装,然后点击accept license -->点击install 完成安装
-
重新打开一个cmd窗口
-
进行验证,输入adb --version ,出现Version 29 就说明版本降级成功;
再次执行forward 命令也成功了
C:\Users\lnz>adb --version
Android Debug Bridge version 1.0.41
Version 29.0.6-6198805
Installed as D:\Program Files (x86)\appium\sdk\platform-tools\adb.exe
C:\Users\lnz>adb -s 192.168.137.103:5555 forward tcp:5555 tcp:5556
5555
C:\Users\lnz>adb -s 192.168.137.102:5555 forward tcp:5551 tcp:5556
5551
C:\Users\lnz>adb forward --list
192.168.137.102:5555 tcp:5555 tcp:5556
192.168.137.102:5555 tcp:5551 tcp:5556