简体   繁体   English

Android:在连接到同一台计算机的不同仿真器/真实设备上运行不同的测试

[英]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.

相关问题 在同一台计算机上为不同的应用程序运行多个jvm - Running multiple jvms for different applications in same machine ANDROID:布局在不同的设备上看起来并不相同 - ANDROID: Layouts do not look the same on different devices 编辑; Android应用程序SQLite异常不同的模拟器 - Edited; Android app SQLite exceptions different emulators 在Android Studio 2.2.3中未检测到USB设备或正在运行的模拟器 - No USB devices or running emulators detected in android studio 2.2.3 在具有相同密度的不同Android设备上具有不同的fling(滑动)速度 - Different fling (swipe) velocity on different Android devices with same density 在testng中使用不同的dataprovider运行相同的测试 - running same test with different dataprovider in testng Android-不同设备上的不同背景 - Android - different background on different devices 在jboss 7.0.2中的同一端口和机器上运行不同的应用程序 - running different application on same port and machine in jboss 7.0.2 将测试移至其他程序包后,TeamCity两次运行同一测试 - TeamCity is running the same test twice, after the test was moved to a different package Android App在模拟器上运行,但在真实设备上崩溃 - Android App running on Emulator but crashes on real devices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM