Setting iOS App Permissions Automatically

February 14, 2026 · 7 min read · Mobile Testing

HeadSpin Platform
Automated & amp; manual testing made easygoing through information science brainstorm.
Differentiating capabilities:
  • Extensive end-to-end automation of QA operation
  • Relative analysis of app performance against peers
  • Continuous monitoring of app execution habituate synthetic data for high handiness of apps
  • Easy-to-use developer friendly program
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Affordable Real Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile test executing in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based examination

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Setting iOS App Permissions AutomaticallySetting iOS App Permissions Automatically

Setting iOS App Permissions Automatically

Published on
November 14, 2018
Updated on
Published on
May 5, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps

There & # x27; s nothing more frustrating when running an iOS examination than to have a system duologue pop up right in the centre of your examination. And it only create issue bad when that dialog is asking whether to grant a certain license to your app. You & # x27; re testing the app, so obviously you want it granted! (Unless of course you & # x27; re quiz what happens when it & # x27; snotgranted, in which case, dialog away.)

Luckily, recent versions of Appium (the late 1.9.2-beta.2 and up) have a new capability that makes it potential to do away with both of these problems simultaneously. The new capability ispermissions, and it lets you set any permit that iOS knows about, from location to notifications to photos. One caveat: the new capacity alone works for simulators, so those of you running on real devices will have to sit taut and keep manually automating those popups.

Setup

Because Appium relies on some newfangled 3rd-party software to make the permit magic happen, we need to get said software on our machines before we try and run our trial. Here & # x27; s what to do (assuming you & # x27; re on a Mac and have Homebrew installed; and if you & # x27; re not using a Mac this guide won & # x27; t be very utile to you anyway!):

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

brewage tap wix/brew brew install wix/brew/applesimutils

The permissions Capability

There are no new commands tied to this feature, only thepermissionscapability. It should be a string, in valid JSON format, with the next structure:

{`` your-bundle-id '': {`` permission-1-name '': `` permission-1-value '', `` permission-2-name '': `` permission-2-value '', ...}}

Of course, supersede all these cook values with ones that make sense for your app. How do you know what permission name and value are available? You can constantly check out theapplesimutils documentationfor the full list, but I will procreate them here:

Available Permissions: calendar=YES|NO|unset camera=YES|NO|unset contacts=YES|NO|unset health=YES|NO|unset homekit=YES|NO|unset location=always|inuse|never|unset medialibrary=YES|NO|unset microphone=YES|NO|unset motion=YES|NO|unset notifications=YES|NO|unset photos=YES|NO|unset reminders=YES|NO|unset siri=YES|NO|unset speech=YES|NO|unset

So let & # x27; s say we want to grant our typical test app to access the GPS datum while the app is in use. In that case, our JSON object should look like:

{`` io.cloudgrey.the-app '': {`` location '': `` inuse ''}}

But of course we need to include this as the capability, so we have to stringify it and include it in our Java client & # x27; s capability builder, like so:

caps.setCapability (`` permissions '', `` {\ '' io.cloudgrey.the-app\ '': {\ '' location\ '': \ '' inuse\ ''}} '');

(Notice that I & # x27; ve had to escape the inner quotes).

This is all we need to do to ensure that, when my app launches and before my test even commence, the permissions I want will already be set, so that I don & # x27; t have to vex about any popups in the trend of my examination. I can also experiment with setting the values otherwise for different tests, if I require to see how my app will behave if a user changes the permission to something else, or turns it off entirely.

I & # x27; ve incorporated this example into a complete code sample, which navigates to a geolocation demonstration view on The App, and attempts to read the parallel and longitude from the view. This of course requires location permissions to be granted, and will only work with the newlicensecapability (try removing the capability, and you & # x27; ll see the popup asking for authorization).

importation io.appium.java_client.MobileBy; import io.appium.java_client.MobileElement; import io.appium.java_client.ios.IOSDriver; importee java.io.IOException; significance java.net.URL; import org.junit.After; meaning org.junit.Before; importee org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.html5.Location; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.ExpectedConditions; signification org.openqa.selenium.support.ui.WebDriverWait; public class Edition043_iOS_Permissions {private String APP = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.8.0/TheApp-v1.8.0.app.zip ''; private IOSDriver driver; private WebDriverWait wait; private By geolocation = MobileBy.AccessibilityId (`` Geolocation Demo ''); @ Before public nullity setUp () throws IOException {DesiredCapabilities caps = new DesiredCapabilities (); caps.setCapability (`` platformName '', `` iOS ''); caps.setCapability (`` platformVersion '', `` 12.1 ''); caps.setCapability (`` deviceName '', `` iPhone 8 ''); caps.setCapability (`` app '', APP); caps.setCapability (`` permissions '', `` {\ '' io.cloudgrey.the-app\ '': {\ '' location\ '': \ '' inuse\ ''}} ''); driver = new IOSDriver(new URL (`` http: //localhost:4723/wd/hub ''), detonator); wait = new WebDriverWait (driver, 10);} @ After public vacuum tearDown () {try {driver.quit ();} catch (Exception ign) {}} @ Test world void testLocationPermissions () {// first, set the geolocation to something arbitrary double newLat = 49.2827, newLong = 123.1207; driver.setLocation (new Location (newLat, newLong, 0)); // now voyage to the location demonstration wait.until (ExpectedConditions.presenceOfElementLocated (geolocation)) .click (); // if permit be set correctly, we should get no popup and instead be // capable to read the parallel and longitude that be previously set By newLatEl = MobileBy.AccessibilityId (`` Latitude: `` + newLat); By newLongEl = MobileBy.AccessibilityId (`` Longitude: `` + newLong); wait.until (ExpectedConditions.presenceOfElementLocated (newLatEl)); wait.until (ExpectedConditions.presenceOfElementLocated (newLongEl));}}

Don & # x27; t block to too have a look at the sampleon GitHub.

Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a dynamic and results-driven Content Marketing Specialist with 8+ eld of experience in crafting employ narration and marketing collateral across diverse industries. She surpass in collaborating with cross-functional squad to acquire advanced content strategies and deliver compelling, reliable, and impactful content that resonates with quarry audiences and enhances brand legitimacy.

LinkedIn

Setting iOS App Permissions Automatically

4 Parts

regression intelligence blog
-

Regression Intelligence hard-nosed usher for innovative exploiter (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence practical guide for advanced users (Part 4)

Coming Soon

Discover how HeadSpin can empower your concern with superior try capabilities

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, derive a competitive edge
faster development cycles
Boost developer/QA productivity with faster development cycles
automated buil-over-build regression testing
Automate build-over-build fixation testing for consistent results
gain better visibility into functional & performance issues
Gain better visibleness into functional and performance issues
reduce mean time
Reduce meanspirited clip to identify/resolve during trial, QA, and product
evaluate audio, video & qoe
Evaluate audio, video, and contented character of experience (QoE) effortlessly
The trusted choice for global initiative
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your business with superior testing capacity

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster development round
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain better visibility into functional and execution number
reduce mean time
Reduce meanspirited time to identify/resolve during test, QA, and product
evaluate audio, video & qoe
Evaluate sound, video, and contented quality of experience (QoE) effortlessly
The trusted choice for global enterprise
Close

Discover how HeadSpin can authorise your job with superior quiz capability

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster development rhythm
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce base time to identify/resolve during trial, QA, and production
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free