I'm developing an iPhone game with Game Center integration. The game is being built as Debug (not release/distribution). On the simulator, Game Center always uses the sandbox properly. On the iPhone device itself, it will go for a few days using the sandbox, then suddenly decide to use the real Game Center servers (which results in an error, because my game has not yet been released). It's been avoiding the sandbox for several days now, and I hate testing on the simulator. Any idea how to once and for all make it use the sandbox during development?
Here's the relevant quote from the Game Kit Programming Guide:
As a developer, your Game Center account may be logged into either Sandbox for testing, or into the live environment but not both. To change which account you are logged into, switch to the built-in Game Center app and log out, then run any Game Center enabled app. If that app is provisioned for development, enter your test account information to log into Sandbox. Otherwise, enter your live account information to log into the live environment.
As far as I can tell, my app is being provisioned using a Developer Provisioning Profile. The build mode is set to Debug. I have signed out of Game Center on the device. I also tried signing out of the Store for good measure.
Deleting the app, logging out from Game Center app, and reinstalling the game from Xcode is what helped over here.
Previous version had no Game Center integration, and that version from App Store was installed on the device. Deleting it and installing again from Xcode apparently cleaned some stale cached information, and got the game to access Sandbox servers.
Also, I followed Apple's advice from the docs to use a separate test account, although I don't think that's what helped.