Q:

Testing multiple Android phones connected to one PC

I am about to develop a test program for mobile phones.
To reduce cost, I want multiple Android phones to one PC, then install test program to the phones and then run the test program at once.
Can it be done? I am using Android SDK and NDK. Phones are not rooted.

A:

Sure.
You can write a simple shell wrapper to run your tests on all connected devices simultaneously - remember their serial-numbers and use this snippet:
$ adb -s serial1 install <your_test_package>.apk 
$ adb -s serial2 install <your_test_package>.apk 
$ adb -s serial1 shell am instrument -w <your_test_package_name>/<runner_class> 
$ adb -s serial2 shell am instrument -w <your_test_package_name>/<runner_class>

For details, consult with

http://developer.android.com/tools/help/adb.html#directingcommands
http://developer.android.com/tools/testing/testing_otheride.html#RunTestsCommand

Also, you can run your tests on any combination of physical devices, AVDs and virtualized Android-x86 installations (using KVM or VirtualBox).

