Cleaning up the iPhone simulator

Solution 1:

From Apples Dev Resources:

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

(On older versions: iPhone Simulator > Reset Content and Settings.)

Solution 2:

The simulator installs apps into:

"$HOME/Library/Application Support/iPhone Simulator/User/Applications"

Also check:

"$HOME/Library/Developer/CoreSimulator/Devices"

The GUID files and directories match up to the simulator's installed apps.

Manually delete all those files/directories to remove all applications from the simulator.

I know there is some way to add scripts to the build process in XCode.

Also it looks as if XCode changes the GUID it uses each build (the directory where my app sits changes between builds in XCode), so trying to delete the same directory all the time won't work. If you are only working on one app at a time then clearing out the entire directory would be an option.

Solution 3:

The way I do this is to simply click and hold on the icon for my app in the simulator--then when it starts to wiggle click the black and white (x). A message will pop up asking whether you really want to delete and you just click yes. The next time you build and deploy your app it will use the new sqlite db without a hitch and you don't have to go muck around in the filesystem.