Deleting Safari Cookies in iOS Simulator

If you are doing any kind of development that involves cookies and need to be able to delete them while testing iOS you will likely need to delete them as well.

The iOS simulator (Launched from Xcode by going to Xcode > Open Developer Tool > iOS Simulator) stores data for the simulator in the following directory on the host Mac OSX file system:  /Users/<uid>/Library/Application Support/iPhone Simulator/

First, quit out of the iOS Simulator.

To find the cookies and delete them open up a terminal and cd to the iPhone Simulator directory.

$ cd /Users/<uid>/Library/Application\ Support/iPhone\ Simulator/

Then execute the following find command to find the cookie data file:

$ find ./ -type f -iname ‘*binarycookies*’ -exec ls -l {} \;
-rw-r–r–  1 ryanchapin  staff  2503 Nov  6 08:32 .//7.0-64/Applications/630F9FE9-87B2-4A6D-8C60-CA70EBC5FD8A/Library/Cookies/Cookies.binarycookies

You can then update the find command to the following to delete the file.

$ find ./ -type f -iname ‘*binarycookies*’ -exec rm {} \;

Leave a Reply