【问题标题】:AWS Device Farm - permissions for Android Instrumented testAWS Device Farm - Android Instrumented 测试的权限
【发布时间】:2021-02-16 07:49:12
【问题描述】:

是否可以为 AWS 设备场中的 espresso 仪器测试授予安全权限?我需要授予“android.permission.ACCESS_BACKGROUND_LOCATION”,在 Android 10 及更高版本中它是安全的,并且只能在应用程序的系统设置中授予。

【问题讨论】:

    标签: android android-instrumentation aws-device-farm


    【解决方案1】:

    您可以在 pre_test 阶段使用以下示例命令在自定义 YML 文件中为 espresso 仪器测试授予安全权限

    # These next lines set the permissions of the app
    - adb shell pm grant io.appium.settings android.permission.ACCESS_COARSE_LOCATION
    - adb shell pm grant io.appium.settings android.permission.ACCESS_FINE_LOCATION
    - adb shell pm grant io.appium.settings android.permission.CHANGE_CONFIGURATION
    - adb shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000
    - adb shell appops set io.appium.settings android:mock_location allow
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-02
      • 1970-01-01
      • 1970-01-01
      • 2016-07-26
      • 2018-02-10
      • 2017-11-11
      • 1970-01-01
      • 2020-01-03
      相关资源
      最近更新 更多