问题描述
我有插在同一台机器上两个不同的Android设备。我想要做的是针对每个设备,并分别在其上运行测试。
I have two different Android devices plugged into the same machine. What I would like to do is to target each device and execute a test on it separately.
不幸的是,它好像我需要拔掉设备之一每次运行测试,因为如果我不这样做,我收到以下错误:
Unfortunately, it seems as if I need to unplug one of the devices to run the test each time, because if I don't, I receive the following error:
error: more than one device and emulator
有谁知道的工作围绕这个问题,使我可以简单地保持插在两个设备和运行我的测试?
Does anyone know of a work-around for this issue so that I can simply keep both devices plugged in and run my tests?
推荐答案
您可以与-s亚行命令中指定的目标设备
You can specify the targeted device on the adb command with -s
1)通过执行获取设备的serialNumber
1) Get the device serialNumber by doing
$ adb devices
List of devices attached
emulator-5554 device
emulator-5556 device
emulator-5558 device
2)传递的的serialNumber与-s参数adb命令
2) Pass in the serialNumber into the adb command with -s argument
$ adb -s <serialNumber> <command>
例如
$ adb -s emulator-5556 install helloWorld.apk
这篇关于一台机器上测试多台Android设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!