Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset iOS Simulator application data to run app for first time

I just finished writing some code that checks if it is the first time the app is running then display a message, if it is not the first time then display another message..

How do you reset the simulator on Xcode so that I can test the app when it runs the first time?

I tried cleaning the build folder but it didn't work..

like image 944
user2301717 Avatar asked Apr 24 '13 15:04

user2301717


People also ask

How do you restart an app on iPhone simulator?

shift+command+H twice to simulate the double tap of home button. swipe your app's screenshot upward to close it.

How do I delete data from simulator?

Run and stop an emulator, and clear data To stop a running emulator, click Menu and select Stop. To clear the data for an emulator, select Wipe Data. Or click Menu and select Wipe Data.

How do you refresh iPhone simulator?

Selecting Reload (or pressing ⌘ + r in the iOS simulator) will reload the JavaScript that powers your application.

Where does the iPhone simulator store its data?

type: ~/Library/Application Support/iPhone Simulator. The Directories are the iOS version of the different Simulators. The Sub Directories are the Apps install on the simulator.


1 Answers

In the iOS Simulator, press iOS Simulator in the menu at the top of the screen, and press 'Reset Content and Settings...'. This will clear the entire simulator.

Or, on the home screen of the simulator, uninstall the app in the same way you would on a physical device, by pressing and holding on the application icon until an 'x' appears in the top left, and press the 'x', and select 'Delete' from the alert view. This will clear all data associated with a single app.

Then do a clean, build and run.

Edit:

As of Xcode 11+ Simulator, this is under Device > Erase All Content and Settings

like image 150
Tim Avatar answered Sep 16 '22 17:09

Tim