Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear iPhone simulator cookies

I have an app that makes request to a REST service. Authentication is done using cookies. This already works.

What I have problems with is to test the case when the cookie is no longer valid and my code has to reauthenticate. To test this I have to wait until the cookie is invalid, which could take some time. To accelerate this I figured that if I delete the cookie it would have the same effect.

How to delete all cookies of an app on the iPhone simulator?

I already tried the following:

Deleting <app-dir>/Library/Cookies/Cookies.binarycookies doesn't work. It seems that my cookies are never written to this file.

Deleting all cookies in NSHTTPCookieStorage on app startup doesn't work either.

like image 860
sliver Avatar asked Dec 13 '10 08:12

sliver


People also ask

How do I clear my Xcode simulator?

To delete individual, available, simulators it's easier to do so through Xcode. Go to Window > Devices and simulators, then select the Simulators tab. You can right-click on any simulator and select 'delete' to get rid of it.

How do you clear local storage in Simulation?

Open the simulator. Open the iOS Simulator, in the top Menu bar: Hardware -> Erase All Content and Settings... . This will clear the whole simulator to default settings as well as remove any apps you have installed and their associated stored data.


1 Answers

YOU CAN RESET THE SIMULATOR

  • Launch the simulator.
  • Click the FIRST item on the "menu bar". It says "iOS Simulator"
  • A menu will appear. Go down three items to "Reset Contents and Settings"
  • Click "Reset" on the dialog which appears

iPhone Simulator Reset Cookies

like image 199
Fattie Avatar answered Nov 15 '22 07:11

Fattie