【问题标题】:How to use Android Test Orchestrator in command line?如何在命令行中使用 Android Test Orchestrator?
【发布时间】:2020-09-03 23:36:08
【问题描述】:

从 CI 运行测试时看到崩溃。阅读这篇关于使用 Android Test Orchestrator 的文章 (https://developer.android.com/training/testing/junit-runner#ato-gradle)。我正在使用 adb 从 CI 运行我的测试。想知道如何安装 Orchestrator。命令行中的apk?

【问题讨论】:

    标签: android testing mobile android-espresso androidjunitrunner


    【解决方案1】:

    如果使用 Orchestrator,您还需要测试服务 apk。

    1. 从 web repo 或本地机器获取 apk:s。本地路径类似于:

      <your cache dir>\.gradle\caches\modules-2\files-2.1\androidx.test\orchestrator\1.4.0-alpha05\ffa651bbb898f0f2bc93c8e9f1296ed5e77768f5\orchestrator-1.4.0-alpha05.apk

      <your cache dir>\.gradle\caches\modules-2\files-2.1\androidx.test.services\test-services\1.4.0-alpha05\2a8f8a5c3f033d0c33e0faf35c6151713a9b0f9d\test-services-1.4.0-alpha05.apk

    2. 将它们放在可以从 cmd 行访问的地方。

    3. 从该位置运行这些行:

      adb install -g -r --force-queryable orchestrator-1.4.0-alpha05.apk

      adb install -g -r --force-queryable test-services-1.4.0-alpha05.apk

    【讨论】:

    • 谢谢! --force-queryable 参数对于 Android 11 及更高版本至关重要。解决了我困扰了数周的问题。为什么这个答案被否决了?
    猜你喜欢
    • 2018-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-01
    • 2020-03-16
    • 2016-08-01
    • 2022-07-26
    • 1970-01-01
    相关资源
    最近更新 更多