这通常是由于第二个设备的权限问题引起的。有两种常见的
adb -s
可以通过运行“adb devices”命令来获取第二个设备的序列号。
androidTestUtil 'com.android.support.test:orchestrator:1.0.1'
然后,在测试的AndroidManifest.xml文件中添加以下代码:
最后,在命令行中运行以下命令:
adb shell am instrument -w com.package.name/android.support.test.runner.AndroidJUnitRunner --no-window-animation --no-isolated-storage --no-restore
这将启动Orchestrator,并在所有连接的设备上运行测试。
希望这可以帮助你解决问题!