Skip to content

app_privacy

Manages privacy permissions for applications on a simulator device. You can grant or revoke specific permissions (such as camera, location, or contacts) for a given app, or reset all permissions to their default state. This eliminates the need to manually interact with system permission dialogs during automated testing and development workflows.

ParameterTypeRequiredDefaultDescription
deviceIdstringYesThe UDID of the target simulator device.
actionenumYesThe privacy action to perform. One of: "grant", "revoke", "reset".
serviceenumYesThe privacy service to modify. One of: "all", "calendar", "contacts-limited", "contacts", "location", "location-always", "photos-add", "photos", "media-library", "microphone", "motion", "reminders", "siri", "speech-recognition", "camera", "faceid", "health", "homekit", "usertracking".
bundleIdstringNo*The bundle identifier of the target app. Required when action is "grant" or "revoke". Optional for "reset" (omit to reset all apps).

“Allow the WeatherApp to use the camera without showing a permission dialog.”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"action": "grant",
"service": "camera",
"bundleId": "com.example.weatherapp"
}

“Give the running app background location access.”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"action": "grant",
"service": "location-always",
"bundleId": "com.example.weatherapp"
}

“Remove photo library permission so I can test the denied state.”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"action": "revoke",
"service": "photos",
"bundleId": "com.example.weatherapp"
}

“Reset all privacy permissions for the shopping app to test the first-launch experience.”

{
"deviceId": "A1B2C3D4-E5F6-7890-ABCD-1234567890EF",
"action": "reset",
"service": "all",
"bundleId": "com.example.shopapp"
}

Reset all permissions for all apps on the simulator

Section titled “Reset all permissions for all apps on the simulator”

“Clear all privacy permission states on this simulator.”

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"action": "reset",
"service": "all"
}

“Set up the app with contacts and calendar access for integration testing.”

First call:

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"action": "grant",
"service": "contacts",
"bundleId": "com.example.weatherapp"
}

Second call:

{
"deviceId": "F3A1B2C3-D4E5-6789-ABCD-EF0123456789",
"action": "grant",
"service": "calendar",
"bundleId": "com.example.weatherapp"
}
Privacy permission updated.
Device: F3A1B2C3-D4E5-6789-ABCD-EF0123456789
Action: grant
Service: camera
Bundle ID: com.example.weatherapp
  • app_launch — Launch the app after configuring its permissions.
  • app_terminate — Restart the app to ensure permission changes take effect.
  • app_install — Install the app before setting its permissions.
  • simulator_erase — Fully reset the simulator, which also clears all permissions.