44

Since 5.0, iOS simulator has StoreKit support so you can debug your In-App purchases without device. But, it has one issue. Once logged in (make In-App purchase) I can't change AppStore login. Settings has not "AppStore" item, so I can't "logout" from account.

I tried to delete application from simulator, restart simulator, delete test user from iTunesConnect — no success.

Screen of the problem

Any idea?

Brian Webster
  • 30,033
  • 48
  • 152
  • 225
Styx
  • 9,863
  • 8
  • 43
  • 53

5 Answers5

80

There is another way to log out from that sandbox account without "Reset Content & Settings" . Just remove the files from the following path in your home directory :

~/Library/Application\ Support/iPhone\ Simulator/5.0/Library/com.apple.itunesstored 

You may also need to restart the Simulator for the change to take effect.

This just removes the stored information about iTunes from Simulator. So it doesn't delete any apps in the Simulator. It works cool :)

Adam Rosenfield
  • 390,455
  • 97
  • 512
  • 589
Tushar
  • 3,022
  • 2
  • 26
  • 26
  • This no longer seems to work in Simulator 6.0. Any other workarounds? – jemmons Sep 26 '12 at 15:22
  • @jemmons It still works in Simulator 6.0 - you need to adjust the path. – Hafthor Oct 29 '12 at 16:53
  • 5
    You'll need to quit the simulator first, too. At least, you do with 6.1. – abscondment Nov 15 '12 at 22:33
  • Kudos. Just what I was looking for. – Jerry Brady Jan 25 '13 at 02:38
  • For 6.1: `rm -rf ~/Library/Application\ Support/iPhone\ Simulator/6.1/Library/com.apple.itunesstored/` – plindberg Feb 19 '13 at 12:23
  • 1
    @plindberg When typing commands that start with `rm -rf ~...` make sure you treat your space bar as if it were the trigger of a loaded gun, pointed at your home directory... if you type `rm -rf ~ /Lib...` on accident, well... `rm` will quickly and studiously do its job and erase your home folder. **Much safer to `cd` into the dir, and only then `rm` the file with the relative path.** – Tim Aug 17 '13 at 22:01
  • @Tim: Yup. [This project](https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/commit/a047be85247755cdbe0acce6f1dafc8beb84f2ac) had a typo that caused `/usr` to be deleted. – Adam Rosenfield Jan 29 '14 at 20:55
33

Try to "Reset content & settings"

Dimitar Marinov
  • 922
  • 6
  • 14
  • This helps, thanks. But maybe there is another way to logout from AppStore? – Styx Nov 06 '11 at 16:37
  • 1
    I doubt there is another way to do this in simulator. Please mark my answer as working :) – Dimitar Marinov Nov 06 '11 at 16:39
  • WHAT THE.. Apple? Seriously, there isn't any option to do this? Do we really have to lose every app settings to simply logout from an iTunes Connect account?! Now we're 2016 with Xcode 8.1 and still not the option! – Martin Nov 28 '16 at 19:11
6

Simulator 6.0 stored information location:

~/Library/Application Support/iPhone Simulator/6.0/Library/com.apple.itunesstored/

Update for 6.1:

~/Library/Application Support/iPhone Simulator/6.1/Library/com.apple.itunesstored/
TONy.W
  • 1,948
  • 19
  • 10
1

With iOS 7 Apple appear to have removed the ability to test In App Purchases using the simulator. Whatever you do (including removing the files in the relevant com.apple.itunesstored simulator directory) you always get the "Could not connect to iTunes store" error when trying to request the product identifiers.

Testing on a device works fine.

UPDATE: I have found that the regular "iPhone Retina (4-inch)" simulator works, but the 64bit simulator doesn't. Very odd.

mluisbrown
  • 14,448
  • 7
  • 58
  • 86
0

To logout from iOS simulator using xCode 6.3.1, go to Setting -> Safari -> Clear History and Website Data.

Saqib Omer
  • 5,387
  • 7
  • 50
  • 71
  • 1
    I didn't see this "Edit/Delete Apple ID" option under Settings/Safari. I do see "Clear History and Website Data", but that doesn't seem to work. :-/ – Erik van der Neut Jun 09 '15 at 04:06