Run Robotium test on multiple devices at the same time

In order to run multiple devices at the same time, you just need to put adb commands in shell script and made earlier ones run in background. In the adb command, specify device by their serial numbers. For example, create test.sh, in which you have

adb -s shell am instrument -w com.mytest.test/android.test.InstrumentationTestRunner&

adb -s shell am instrument -w com.mytest.test/android.test.InstrumentationTestRunner

That’s it!

The best part is that by combining this with auto build and deployment (hint: apache) , you can get fully automated test on multiple devices.

Video below shows a test suite of three very basic tests running on three devices (two physical and a simulator )at the same time.

Advertisements

6 thoughts on “Run Robotium test on multiple devices at the same time

  1. I am using windows batch file to run m test in multiple devices. If I put & at the end of each adb command, the test running in each device one by one, but not at a time in all the devices, let me know how to do this in windows batch file.

    • The & will work only if your batch support background task. Windows cmd does not. If you do it in Linux or Max, this will work. On windows you can try Cygwin or Powershell. I haven’t tried this myself though, because I use Mac.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s