29

I want to test out the contact authorization process, but the simulator doesn't ask me for permission anymore. I've tried resetting privacy settings, I've tried resetting the simulator completely, I've tried deleting the app, but no matter what, it never asks me for permission. It just assumes I've granted it.

I'm running iOS 6 simulator. There are a couple similar questions like this on SO, but surprisingly no decent answers. Is there really no way to do this?

Community
  • 1
  • 1
Snowman
  • 31,411
  • 46
  • 180
  • 303

5 Answers5

44

Starting with iOS 7, go to Settings, General, Reset and tap Reset Location & Privacy

shim
  • 9,289
  • 12
  • 69
  • 108
laktak
  • 57,064
  • 17
  • 134
  • 164
  • 1
    I confirmed that this answer is valid for iOS 9 Simulator as well. My app throws up a system alert that "App would like to access photos". I was able to reset this alert's state using the above instructions (i.e make it so the alert is thrown again). – Vish Nov 02 '15 at 09:05
  • 1
    I was able to reset permissions for the iOS 8.1 simulator by going to Simulator -> Reset Content and Settings in the simulator menu. Reset Location & Privacy did not seem to work for me. – Mike W Feb 05 '16 at 23:27
  • This doesn't work on simulators where this option doesn't exist but if you switch to a real device it does the job. – Declan McKenna Apr 01 '22 at 12:06
4

You can now use xcrun simctl privacy to control these settings.

Examples:

  • xcrun simctl privacy booted reset all will reset all supported permissions for all apps installed in the currently booted simulator.
  • xcrun simctl privacy booted revoke contacts com.example.my-app will deny permission for full contact access for just the given Bundle ID on the currently booted simulator.

See xcrun simctl help privacy for more details.

russbishop
  • 16,587
  • 7
  • 61
  • 74
2

The reset locations/privacy option ONLY works on a device. It doesn't work in the simulator.

Edit: This is no longer true, see laktak's answer.

SafeFastExpressive
  • 3,637
  • 2
  • 32
  • 39
2

These instructions are for Xcode 6.

  1. Find the identifier of the simulator whose access settings you want to reset in Xcode's Devices window.

  2. Delete ~/Library/Developer/CoreSimulator/Devices/<device>/data/Library/TCC/TCC.db

  3. Relaunch the simulator. (Device > Restart in the simulator menu)

Declan McKenna
  • 4,321
  • 6
  • 54
  • 72
s4y
  • 50,525
  • 12
  • 70
  • 98
0

Seems like this has changed. To reset permissions go to:

Settings > Privacy > Contacts