You test iOS purchases in three environments with no real money. A StoreKit configuration file in Xcode (since Xcode 12 in 2020) works without App Store Connect, the sandbox pulls purchases from App Store Connect and renews a monthly plan every 5 minutes by default, and TestFlight runs on the same sandbox and renews once a day (Apple's help as of October 17, 2026).
Three environments and how they differ
Apple splits purchase testing into three environments (StoreKit documentation). In Xcode, purchases live in a .storekit file inside the project, you need neither a network nor App Store Connect, and Xcode signs the transactions itself. Apple introduced this environment in 2020 with Xcode 12. The sandbox uses the real purchases from App Store Connect, the App Store signs the transactions and your server receives notifications. TestFlight sits on top of the same sandbox. None of them charge money or send purchase and refund emails.
Some scenarios only work in Xcode. There you can force a StoreKit error, approve or decline an Ask to Buy purchase and try a subscription price increase. Country prices only show properly in the sandbox, since the Xcode file holds a placeholder price.
Where it lives in App Store Connect and Xcode
Test accounts are created under App Store Connect › Users and Access › Sandbox › (+). You need a name, an email, a password and one of 175 storefronts. The email can't already be an Apple Account, and the name, email and password can't be changed later. On iPhone the test account appears under Settings › Developer after the first purchase in a build from Xcode, and Manage opens its settings.
In Xcode you create the file from the File › New menu, typing storekit in the filter. You turn it on in Edit Scheme › Run › Options › StoreKit Configuration, and only one file can be active. A file synced with App Store Connect arrived in Xcode 14, more on it on the StoreKit 2 page.
Renewal speed in the sandbox
| Subscription duration | Sandbox default | Fastest rate | TestFlight |
|---|---|---|---|
| 1 week | 3 minutes | 3 minutes | 1 day |
| 1 month | 5 minutes | 3 minutes | 1 day |
| 2 months | 10 minutes | 6 minutes | 1 day |
| 3 months | 15 minutes | 9 minutes | 1 day |
| 6 months | 30 minutes | 18 minutes | 1 day |
| 1 year | 1 hour | 36 minutes | 1 day |
| Billing retry | 10 minutes | 6 minutes | only with a sandbox account |
| How many renewals | up to 12, auto-renew turns off on the 13th | same | up to 6 in a week |
Per App Store Connect Help and TestFlight purchase testing, checked October 17, 2026.
You change the rate under App Store Connect › Users and Access › Sandbox › account › Subscription Renewal Rate, and the slower options, every 30 minutes or every hour, stretch a year to 6 or 12 hours.
How to test purchases, step by step
- Before anything exists in App Store Connect, describe purchases in a local .storekit file and run a purchase, a restore and a failed payment in the simulator.
- Sign the Paid Apps Agreement and set up the purchases in App Store Connect, or the sandbox won't return them. Edits reach the sandbox within an hour.
- Create sandbox accounts for different countries, plus-sign email subaddresses work.
- Run a build from Xcode on an iPhone with Developer Mode on and buy a subscription. When you sign in with the sandbox account, the sheet shows Environment Sandbox, and without that label you are in production.
- Watch 12 renewals, then turn on Interrupt Purchases and try an interrupted purchase (iOS 14 and later).
- Press Clear Purchase History to get the free trial again and repeat the introductory offer flow.
- Send the build to TestFlight and watch other people buy.
Common mistakes
- Signing in to the main Apple Account with a sandbox account. For purchases, sign in under Settings › Developer. Otherwise testing breaks, and with TestFlight you can lose access to your own purchases.
- Judging retention from TestFlight. Every plan there renews daily and only 6 times, which tests payment and says nothing about how people behave.
- Trusting prices in the Xcode file. The .storekit price is a placeholder unrelated to Apple's price points, so check prices in the sandbox.
- Testing someone else's app with your sandbox account. It only works for apps in the same developer account.
In Appto the agent writes the app in SwiftUI as a regular Xcode project and walks through every screen in the simulator itself, and you can try a purchase by hand on your iPhone or through TestFlight (app code in Appto).
Questions
Can I test in-app purchases in the simulator?
Yes, with a StoreKit configuration file, which has worked since Xcode 12 in 2020 with no network and no App Store Connect.
How fast do subscriptions renew in the sandbox?
By default a month takes 5 minutes and a year takes an hour. A plan renews up to 12 times and auto-renew turns off on the 13th (App Store Connect Help as of October 17, 2026).
How many sandbox accounts can I create?
Up to 10,000 under App Store Connect › Users and Access › Sandbox. Each one belongs to one of 175 storefronts, and the country can be changed.
Does TestFlight charge for purchases?
No. TestFlight uses the sandbox, and subscriptions there renew once a day, up to 6 times in a week.
Build your own app in Appto
Appto checks the niche on fresh App Store data, designs the screens, writes the code, builds the App Store page and submits to Apple from your account or shows you what to press in App Store Connect. Runs on your own Claude Code or Codex.
Download for Mac