iOS 12 IAP Sandbox
iOS 12.1.2 seems to have simplified the process even further than Jamie's steps without the need to sign-out of anything:
- While still signed into your phone with your personal Apple ID, open a development app (NOT signed for release)
- Try to complete an IAP, which brings up the iTunes Store login page
- Use your sandbox ID here (NOT your personal Apple ID)
- You may have to log in twice (another popup asks for just your password)
- The sandboxed purchase should go through
- Going to
Settings > iTunes & App Store
and scrolling to the bottom now shows a new Sandbox account that says "This account will be only used for testing your in-app purchases while developing locally. Your existing App Store account will be used for TestFlight apps."
That last bit about TestFlight apps is different than the OP's screenshot. Perhaps this method ONLY sets up the account for development IAP testing, whereas the full sign-out method sets up the sandbox account for more.
Just tried it now on iOS 12.0.1.
In
Settings > Apple ID > iTunes & App Stores
, click on your Apple ID (at the top of the page; it's hyperlinked). Then, select "Sign Out".As far as I understand, you are now still signed into your Apple ID for various services like iCloud and Game Center. This is fine.
Open an app that is not signed for release (e.g. an app that you are developing IAPs on).
Try to complete an IAP (restoring purchases, or just getting the app to request your receipt, will also suffice); this will prompt the iTunes Store to ask for your login details again.
The login alert is simply entitled "Sign In to iTunes Store", and prompts you to enter an Apple ID and Password. Do not enter your personal Apple ID here; instead, enter a sandbox account's username and password.
In my case, I had initiated an IAP transaction, so I received an alert entitled "Confirm your In-App Purchase" with details of the IAP and the text "[Environment: Sandbox]"; confirm the purchase by entering your sandbox account's password.
I then received an alert entitled "Sign in to iTunes Store", this time explicitly asking me to enter the password for my sandbox account.
I returned to
Settings > Apple ID
and tappediTunes & App Stores
. This produced an alert saying words to the effect of "It appears that you are using [your personal Apple ID] in the Game Center; is this the same Apple ID that you want to log into iTunes with?". In this case, you should click 'Continue'. It will take you to theiTunes & App Stores
screen. Note that I did not have to enter the password nor re-specify the Apple ID for this step!On the
iTunes & App Stores
screen, your personal Apple ID will be indicated at the top of the screen as before. At the bottom of the screen, you will find that the Sandbox Account field has appeared! ð
This process could have done with some better documentation to accompany the hype, but unfortunately this is just "business as usual" for iOS development.