Setting Up for Test Purchases

Setting Up for Test Purchases

To test your In-app Billing implementation with actual in-app purchases, you will need to click to download the JSON Data File, there by obtaining the file amazon.sdktester for conducting TEST PURCHASES and then copy this file to your device in the root folder.


App Tester

The App Tester is a developer tool that allows users of the Amazon Mobile App SDK to test their implementation in a production-like environment before submitting it to Amazon for publication. This will allow developers to construct test cases that cover all responses generated by the Amazon Mobile App SDK APIs, and give them confidence their apps will be published and run correctly.

In a live environment, your app makes API calls to the Amazon Mobile App SDK libraries. These libraries, in turn, make IPC calls to the Amazon Appstore on the device. The Amazon Appstore then communicates with the Amazon services to fulfill requests such as the purchase of a consumable item, or a subscription to a magazine.

Only apps that have been approved and published through the Amazon Apps & Games Developer Portal can communicate with the Amazon Appstore. This is a problem for developers who want to see how their apps run in a live environment before it is submitted for publication. The App Tester was created to solve this problem.

This document will describe the use of the App Tester to test apps using the Amazon In-App Purchasing APIs (IAP APIs). This is the mechanism of shopping at amazon API:



If a purchase was made with the SDK tester active, then a new build of the same app is run, the new build will never see the old purchase record.

The API libraries will detect whether your app has been published through the Amazon Apps & Games Developer Portal. If it has, the API will exchange data with the Amazon Appstore. If the API detects that the app has not been published through the portal, the API will exchange data with App Tester. This ensures that you will be able to use the same codebase for testing that you intend to submit for publication.

Since your app's interface with the Amazon Appstore is isolated to the API libraries, your app will not know that it is talking with App Tester. Because you have control over the responses given by the App Tester, you can test your app's behavior under any response condition.

Before using the App Tester, developers should be familiar with the IAP APIs as described in the documentation available within the Amazon Apps & Games Developer Portal. Testing an app using the App Tester requires:

  • An Android Development Environment that allows logging via ADB (Logcat)

  • An Android device supporting minimum SDK version 10

  • An Android app that uses the Amazon In-App Purchasing APIs

  • The Amazon App Tester

  • A JSON data file (amazon.sdktester.json) that contains IAP item information

It is assumed that the developer has an environment that supports ADB and can capture logging information from the device under test via Logcat.

For help developing an application that uses the IAP APIs, you can see detailed documentation and sample code on the Amazon Apps & Games Developer Portal.

You can download the App Tester from the Amazon Appstore.

The following section will describe how to create a JSON data file that can be used with the App Tester, followed by instructions for configuring and using the App Tester as part of your test procedures.


Using App Tester

Once you have loaded the app under test, the App Tester , and the JSON data file onto the device, you are ready to start testing the IAP API portions of your application. This section will walk you through each of the screens and explain their use during the test cycle.