如何在多个设备上运行Uiautomator测试?

时间:2014-08-14 06:19:52

标签: android-testing uiautomator android-uiautomator gradle-android-test-plugi

我正在尝试在.bat文件中进行Uiautomator android Ui测试。但我无法让它们并行运行。

这是我的执行流程,已连接3台设备

- > adb devices XXXX XXXX XXXX

- > adb push ./bin/UiautomatorTests.jar /data/local/tmp/

- > adb shell uiautomator runtest UiautomatorTests.jar -c com.music.tests

这里我如何为所有设备提供一个共同的通用命令来运行

2 个答案:

答案 0 :(得分:3)

你可以使用

adb -s <device_id> push ./bin/UiautomatorTests.jar /data/local/tmp/
adb -s <device_id> shell uiautomator runtest UiautomatorTests.jar -c com.music.tests

使用上述命令,您可以运行自动更改<device id>的3个并行实例

您可以从<device id>

找到adb devices 祝你好运!!

答案 1 :(得分:1)

您可以结帐Uiautomator-bot,因为它似乎符合您的要求。它可以在所有连接的设备上同时运行UIautomator测试用例。 有关详细信息,请查看此link