Pular para o conteúdo

Mais visitados

Visitados recentemente

navigation

Testing Your In-app Billing App

This lesson teaches you to

  1. Test with static responses
  2. Test with your own product IDs

You should also read

To ensure that In-app Billing is functioning correctly in your app, you must test the app before you publish it on Google Play. Early testing also helps to ensure that the user flow for purchasing in-app items is not confusing or slow, and that users can see their newly purchased items in a timely way.

Test with static responses

Test your In-app Billing app with static responses by using Google Play's reserved product IDs. By using reserved product IDs instead of actual product IDs, you can test the purchase flow without specifying an actual payment method or transferring money. To learn more about reserved product IDs, see Testing In-app Billing.

Test with your own product IDs

Because Google Play doesn't allow you to use your developer account to directly purchase in-app products that you create yourself, you need to create test acccounts under your developer account profile. To create a test account, simply enter a valid Google email address. Users with these test accounts are able to make in-app-billing purchases from uploaded, unpublished apps that you manage. The signature of the unpublished apps doesn't need to match the published versions.

To test your In-app Billing app using your own product IDs:

  1. In the Play Console, add one or more tester accounts to the developer account that you are using to publish your app by completing the following steps:

    a. Login to the Play Console with your developer account.

    b. Click Settings > Developer account > Account details, and then in the License Testing section, add the Google email addresses for your tester accounts.

  2. Build a signed APK file for your In-app Billing app. To learn how to build and sign your APK, see Building Your Application for Release.

  3. Make sure that you have uploaded the signed APK for your app to the Play Console, and associated one or more in-app products with your app. You don't need to publish the app on Google Play to test it.

  4. Install the APK file to your physical test device by using either the adb tool, or the Play button in Android Studio. To learn how to install the app, see Running on a Device. Make sure that your test device is running on Android 2.2 (API level 8) or higher and is installed with Google Play client Version 3.9.16 or higher.

  5. Login to the test device by using a tester account. Test your In-app Billing app by purchasing a few items, and fix any issues that you encounter. To learn more about how you can perform large-scale testing of your In-app Billing app, see Test Purchases (In-app Billing Sandbox).

Este site usa cookies para armazenar suas preferências quanto às opções de idioma e exibição específicas ao site.

Receba as dicas e notícias mais recentes para desenvolvedores Android que ajudarão você a ter sucesso no Google Play.

* Campos obrigatórios

Uhu!

Siga o Google Developers no WeChat

Navegar neste site em ?

Você solicitou uma página em , mas sua preferência de idioma para este site está definida como .

Quer alterar sua preferência de idioma e navegar neste site em ? Para alterar a preferência de idioma depois, use o menu de idiomas na parte inferior de cada página.

É preciso ter o nível de API ou superior para esta aula

Este documento está oculto porque o nível de API selecionado para a documentação é o . Para alterar o nível, clique no seletor acima da barra de navegação esquerda.

Para mais informações sobre como especificar o nível de API que o seu app precisa, leia o artigo Compatibilidade com diferentes versões de plataforma.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)