I am using IOS for testing in flutter. When permission dialog appears, how can I grant permission inside testing?


Solution 1: Khamidjon Khamidov

In this link, I found another solution:

For Andriod:

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>

For 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>