Configure sandbox testing

Configuring your Android app to enable sandbox testing can be sometimes a daunting task.
But no worry, we listed below all the steps required to make it work!

Add testing account

You'll need to add the Android primary account of the phone you're using for testing, it is the email you used when you logged in for the first time on your Android device (note the only way to change a primary account is to do a factory reset).

In order to do that go to your Google Play console.
Go to Setup > License testing and add your email in the text input.

Create closed track

You'll need to publish a signed version of your app in a closed track.

In order to do that go to the Google Play console in Release > Testing > Closed testing.

Create list of testers

After creating the closed track you'll have the possibility to create a list of testers.
Create an email list by clicking on the link.

A modal should appear, add the email account of the phone you're using for testing and press ENTER.

Join the testing

In order to join the testing you must open the opt-in url from the device you're using for testing (you can send the link to your device by email for example). After opening the link on the device, click on the button Become a tester.

Upload signed APK to the closed track

Generate a signed APK or use Android App Bundle to upload your app to the closed track you've created previously.
Rolling out the release isn't even necessary, just upload your app. After your release is approved and available to the selected users, the sandbox testing should work.

Finally

Build and run your app on the device you're using for testing, there is no need to use the signed APK you've uploaded.
If configured properly, you should be able to load and purchase your products.

When starting a purchase you should see: This is a test order, you will not be charged.

If you can't load the products, please check:

  • You're using a real device, do not use the simulator.
  • The release is available in at least one country.
  • You're using the same Bundle ID (Application ID) you've configured on the Google Play Console when you've created the app.
  • You're logged in on the Google Play Store.
  • You have a PIN configured (some devices require a PIN to purchase a subscription).

For more informations, please go to the official Google Play documentation: Test Google Play Billing