[英]Android: Running different test on different Emulators/real devices attached to same machine
I have three different test applications which are installed in three different emulators and I need to initiate those test at the same time. 我有三个不同的测试应用程序,它们安装在三个不同的模拟器中,我需要同时启动这些测试。 But am not sure how would I do this.
但是不知道我该怎么做。 Requirement is to run these test from same machine in different devices/emulators.
要求是在同一台计算机上的不同设备/仿真器中运行这些测试。
I am trying to write a script having the adb
commands for running tests but am not sure how would I decide which test to run on which device. 我正在尝试编写包含
adb
命令以运行测试的脚本,但不确定如何决定在哪个设备上运行哪个测试。 Here are the commands : 以下是命令:
./adb shell am instrument -w com.pb.demo.test1/android.test.InstrumentationTestRunner
./adb shell am instrument -w com.org.demo.test2/android.test.InstrumentationTestRunner
./adb shell am instrument -w com.demo.ec.test3/android.test.InstrumentationTestRunner
And I have scheduled this script to run at a particular time. 而且我已安排此脚本在特定时间运行。 So when this script would trigger, three different test cases should be initiated on three different devices
attached to same machine(for eg my local)
. 因此,当该脚本触发时,应在
attached to same machine(for eg my local)
三个不同设备attached to same machine(for eg my local)
设备) attached to same machine(for eg my local)
启动三个不同的测试案例。
How can I achieve this? 我该如何实现? How would I change my commands such that they know which emulator to run test on?
如何更改命令,使它们知道要在哪个模拟器上运行测试? Is it really feasible?
真的可行吗? Please guide.
请指导。
PS: I am using genymotion for multiple emulators. PS:我正在将genymotion用于多个仿真器。 These are
192.168.56.101:5555 device 192.168.56.102:5555 device
这些是
192.168.56.101:5555 device 192.168.56.102:5555 device
You can also use following way to launch your emulator 您还可以使用以下方式启动模拟器
CD C:/Users/XXX/AppData/Local/Android/android-sdk/tools
emulator -avd Device-2 -port 5561
In above command Device-2 will launch on port 5561 and note that port no should be more than 5554 在上面的命令中,设备2将在端口5561上启动,并注意端口号不应超过5554。
您可以在调用adb时使用“ -s Device”选项: http : //developer.android.com/tools/help/adb.html#directingcommands
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.