【问题标题】:Allow permission dialog in Flutter end-to-end testing in IOS?在 IOS 的 Flutter 端到端测试中允许权限对话框?
【发布时间】:2021-05-26 11:48:24
【问题描述】:

我正在使用 IOS 进行 Flutter 测试。出现权限对话框时,如何在测试中授予权限?

【问题讨论】:

  • 我想你可以用xcrun simctl 做到这一点。 xcrun simctl privacy <device-ID> grant all <bundle-id> 将授予所有权限。然后你就可以开始运行你的测试了。要知道它授予的所有权限,请执行xcrun simctl privacy

标签: flutter testing


【解决方案1】:

在这个link,我找到了另一个解决方案:

对于安卓:

adb shell pm grant <appId> android.permission.ACCESS_COARSE_LOCATION

flutter drive \
  --driver=integration_test/driver.dart \
  --target=integration_test/location_test.dart \
  -d <deviceId>

对于IOS:

brew tap wix/brew
brew install applesimutils
applesimutils --byId <deviceId> --bundle <appId> --setPermissions location=always

flutter drive \
 --driver=integration_test/driver.dart \
 --target=integration_test/location_test.dart \
 -d <deviceId>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-26
    • 1970-01-01
    • 2022-11-29
    • 1970-01-01
    • 1970-01-01
    • 2017-02-28
    • 1970-01-01
    • 2021-07-03
    相关资源
    最近更新 更多