iOS Development Tutorial: Setting Up a Sandbox to Test In-App Purchasing

If you’re planning to create an iPhone or iPad app that incorporates in-app purchasing, you will need to need to test its functionality well before you’re able to take payments from real users. In this post, we’re going to quickly walk you through the process Apple provides for creating a test user account to make virtual purchases without racking up a real bill.

This tip is adapted from Chapter 3 of our Mastering iOS Development – In-App Purchasing short course. It’s currently available streaming in the Learning Library, as a direct download for $24.95, or as part of the Mastering iOS training bundle.

Licensing and Accounts

The first step in setting up a test account for iOS is making sure that your developer account is fully registered and configured.

Go to the iTunes Connect site and sign in with your developer account. Agree to any Terms and Conditions screen you are presented with after logging in.

Next, click on the Contracts, Tax, and Banking section from your dashboard, highlighted below.


You must make sure that you’ve requested an iOS Paid Applications account, and all proper documentation has been filed. Without proper authorization, your iOS app purchasing (even test purchases) will not work.

Creating the Test User

Next, from the iTunes Connect main screen, click on the Manage Users section from the bottom left. Then select Test User as shown below.


Click to Add New User on the following screen, and you’ll be presented with the Test User information form show below. You will use this login for all virtual purchases done for testing purchases throughout the development of your app.


Sign in on Your Device

Because in-App purchasing doesn’t function particularly well within the emulator, you will want to test all purchases from a physical device. Log out of any regular account you use on the device, and use the new Test User account with the credentials you created in the previous step.

When the development environment is running, your entire project will be sandboxed, and any purchases made by the test account will be free of charge.



Save $50 when you sign up for an annual Learning Library account Learn More