Handling iOS12 Changes to App Permissions

Prior to iOS12, App Permissions were displayed every time the app under test was uninstalled/re-installed. However, this no longer occurs. In App Permissions are only displayed once in a 24 Hour Period. I am not sure why this was changed, but it has severely impacted my automation scripts.

Has anyone out there found a viable work-around in order to change the state of permissions? What I need to do is change, for example, Contacts from allowed, to denied, and then in the next test, allow Contacts and deny Photos, etc.

I have tried launching settings by using:
“self.driver.execute_script(‘mobile: launchApp’, {‘bundleId’: ‘com.apple.Preferences’})”
or by backgrounding the app and selecting the icon…but I can never reliably find elements within the Settings app.

I have also tried initiating another session using a 2nd appium server in order to launch the settings app, but the Settings app is not launched!!! However, if I manually click on settings after the session is setup, I can reliably find elements!!! No idea why it is not launching the app though…it just gets stuck before launching and hangs forever.

Any help with this would be huge,


So far, I have found that changing Region on the iOS device and then reinstalling will clear permissions…but unfortunately with latest Xcode and Appium, I still cannot reliably complete that task via automation…