---
title: Testing at all stages of development with Xcode and the sandbox
framework: storekit
role: article
role_heading: Article
path: storekit/testing-at-all-stages-of-development-with-xcode-and-the-sandbox
---

# Testing at all stages of development with Xcode and the sandbox

Verify your implementation of In-App Purchases by testing your code throughout its development.

## Overview

Overview Use the Apple sandbox and Xcode test environments to test your implementation of in-app purchases using the StoreKit framework. Comprehensive testing can help you: Ensure a seamless purchase flow to provide a positive customer experience in your app. Implement sound logic that covers all scenarios, such as purchases, restores, and subscription offers. Validate that purchases behave correctly in production after your app is available in the App Store. The tools you need to test in-app purchases, non-renewing subscriptions, and auto-renewable subscriptions from early development through beta testing are: Choose the tools that support the test scenarios you need. Make sure you’re able to perform the setup required for the tools you choose. During the early stages of development, you may not be ready to configure in-app purchases in App Store Connect. StoreKit Testing in Xcode lets you configure the information locally. You can test StoreKit transactions before you create Sandbox Apple Accounts, without a network connection. You can test your app in Simulator or on real devices. After you set up in-app purchases in App Store Connect, start using the sandbox environment to test the product information your app will use in production. Testing in the sandbox lets you test transactions from end-to-end and from your app to your server. You can also test any server-to-server functionalities your app depends on, such as transaction validation and App Store Server Notifications. TestFlight lets you get feedback from members of your team or from external testers. TestFlight uses the sandbox environment for in-app purchases. Transactions and purchases that occur in the sandbox don’t incur charges. The following table compares the test environments and features:  |  |  |   |  |  |   |  |  |   |  |  |  None of the test environments charge users when they test buying a product. The App Store doesn’t send emails for purchases or refunds made in the test environments. Control the test environment To set up and run test scenarios, you often need to control the test environment. For example, you may want to reset a test account to rerun the same test multiple times, or mimic actions users take outside your app that affect the test conditions. The following table shows the capabilities each tool has to control the test environment:  |  |   |  |   |  |   |  |   |  |   |  |   |  |  For more information about speeding up renewal periods for testing, see Test in-app purchases. Test common StoreKit scenarios All apps that offer in-app purchases need to support restoring purchases, displaying in-app purchases to the customer, and handling basic transactions. The following table lists common test scenarios and whether they’re testable in the sandbox or Xcode:  |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |  Test subscriptions and Ask to Buy Depending on the in-app purchases your app offers, you may need to test scenarios that involve auto-renewing subscriptions, introductory offers, promotional offers, and Ask to Buy. The following table lists test scenarios and whether they’re testable in the sandbox or Xcode:  |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |   |  |  For more information, see Approve what kids buy with Ask to Buy and Testing introductory offers.

## See Also

### In-App Purchase Testing

- [Testing In-App Purchases with sandbox](storekit/testing-in-app-purchases-with-sandbox.md)
- [Testing refund requests](storekit/testing-refund-requests.md)
- [Testing win-back offers in Xcode](storekit/testing-win-back-offers-in-xcode.md)
- [Testing Ask to Buy in Xcode](storekit/testing-ask-to-buy-in-xcode.md)
