微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AWS Device Farm - Android Instrumented 测试的权限

如何解决AWS Device Farm - Android Instrumented 测试的权限

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

解决方法

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

# 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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。