How to reset iPhone simulator

IphoneIos Simulator

Iphone Problem Overview


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?

Iphone Solutions


Solution 1 - Iphone

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"

Solution 2 - Iphone

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

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

Solution 3 - Iphone

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.

Solution 4 - Iphone

For Xcode 11.4

Device -> Erase All Content and Settings...

Image

Solution 5 - Iphone

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

Solution 6 - Iphone

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

Solution 7 - Iphone

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.

Solution 8 - Iphone

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSteMaView Question on Stackoverflow
Solution 1 - IphoneneoneyeView Answer on Stackoverflow
Solution 2 - IphoneMisha KarpenkoView Answer on Stackoverflow
Solution 3 - IphoneStephane JAISView Answer on Stackoverflow
Solution 4 - IphonejameseroniousView Answer on Stackoverflow
Solution 5 - IphoneAshishView Answer on Stackoverflow
Solution 6 - IphonebeimenjunView Answer on Stackoverflow
Solution 7 - IphoneMichael DominoView Answer on Stackoverflow
Solution 8 - IphoneFranckView Answer on Stackoverflow