简体   繁体   中英

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. 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) .

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. These are 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

您可以在调用adb时使用“ -s Device”选项: http : //developer.android.com/tools/help/adb.html#directingcommands

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM