91

My app uses the location service. To test what is happening when the user presses 'Don't allow' when the simulator asks for the permission to access the location service (when the app is started for the first time) I need to reset the simulator. This because the question was answered at the beginning of the development process with allow. So no more questions are asked.

Resetting the Simulator with "Resetting Content and Settings.." don't bring back the question at the start. What I am doing wrong?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
SteMa
  • 2,945
  • 2
  • 24
  • 30

8 Answers8

190

For iOS 14 and newer:

Device > Erase All Contents and Settings...

For iOS 11 and newer:

Hardware > Erase All Contents and Settings...

For previous versions:

Simulator > Reset Content and Settings...

(In earlier versions of the simulator the top menu entry label was "iOS Simulator"

João Nunes
  • 3,751
  • 31
  • 32
neoneye
  • 50,398
  • 25
  • 166
  • 151
81

For iOS 11 and newer, you need to go the top system menu and select:

"Hardware" > "Erase All Contents and Settings..."

Misha Karpenko
  • 2,168
  • 17
  • 18
18

If you're using Snow Leopard:

Go to your mac's System Preferences (not the simulator's), Select the Security section. Hit the "Reset Warnings" button in front of Location Services, you're all set.

Stephane JAIS
  • 1,413
  • 15
  • 14
8

Or you can choose simctl to manage iOS simulator in Command Line.

$ xcrun simctl erase all is too erase all content in all simulator.

For more information, you can read this blog from XCBlog: https://medium.com/xcblog/simctl-control-ios-simulators-from-command-line-78b9006a20dc

beimenjun
  • 753
  • 7
  • 6
8

For Xcode 11.4

Device -> Erase All Content and Settings...

Image

jameseronious
  • 219
  • 2
  • 5
6

Apple says

To set the user content and settings of the simulator to their factory state and remove the applications you have installed, choose iPhone Simulator > Reset Content and Settings.

http://support.apple.com/kb/ht2110

Rohit Mandiwal
  • 10,258
  • 5
  • 70
  • 83
  • I couldn't find this comment in Apple's current documentation, though the menu item is present and works as of Xcode 5.1.1 and Simulator 7.1. I did find a 2012 document containing the statement. The document is archived here: http://nathanmock.com/files/com.apple.adc.documentation.AppleiOS6.0.iOSLibrary.docset/Contents/Resources/Documents/#documentation/Xcode/Conceptual/ios_development_workflow/25-Using_iOS_Simulator/ios_simulator_application.html – leanne Apr 23 '14 at 02:22
4

I tried "Erase All Content and Settings" in Simulator 10.0, but it didn't work. What worked for me is that in Simulator 10.0, the Settings app is built in. You can reset by:

  1. Clicking on the Settings app to start it.
  2. Click General.
  3. Click Reset.
  4. Click Reset Location & Privacy.
  5. Click Reset Warnings.

Then your authorization status will be reset to .notDetermined.

Michael Domino
  • 409
  • 2
  • 9
  • For me I needed to test asking for the native location permissions, so reseting the location & privacy settings was the easiest and quickest way to test this. – James111 Dec 09 '17 at 02:16
  • It works for me and it is a nicer solution instead of erasing all contents – Fatih Taşdemir Jun 15 '20 at 10:26
3

Nice and handy tool. The great Fastlane commandline tools (https://github.com/fastlane/snapshot)

snapshot reset_simulators

reset_simulators is removing all simulators and create new one only for the latest iOS version. If you want to recreate simulators for other versions you have to provide the list of the versions after the --ios argument, e.g.

snapshot reset_simulators --ios 8.3,8.4,9.0,9.1
Franck
  • 8,939
  • 8
  • 39
  • 57