roger_that
roger_that

Reputation: 9791

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 e.g. 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

Upvotes: 0

Views: 810

Answers (2)

Pavan T
Pavan T

Reputation: 756

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

Upvotes: 1

ph0b
ph0b

Reputation: 14463

You can use "-s Device" option when calling adb: http://developer.android.com/tools/help/adb.html#directingcommands

Upvotes: 0

Related Questions