Langsung ke konten

Paling sering dikunjungi

Terakhir dikunjungi

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).

Situs ini menggunakan cookies untuk menyimpan preferensi Anda tentang bahasa di situs tertentu dan opsi tampilan.

Dapatkan berita dan tips terbaru dari developer Android yang akan membantu Anda mencapai kesuksesan di Google Play.

* Wajib Diisi

Hore!

Ikuti Google Developers di WeChat

Buka situs ini dalam bahasa ?

Anda meminta halaman dalam bahasa , namun preferensi bahasa untuk situs ini adalah .

Ingin mengubah preferensi bahasa dan mengakses situs ini dalam bahasa ? Jika nanti Anda ingin mengubah preferensi bahasa, gunakan menu bahasa di bagian bawah setiap halaman.

Kelas ini memerlukan tingkat API atau yang lebih tinggi

Dokumen ini tersembunyi karena level API yang Anda pilih untuk dokumentasi ini adalah . Anda dapat mengubah level API dokumentasi dengan pemilih di atas menu navigasi sebelah kiri.

Untuk informasi lebih lanjut tentang menentukan level API yang diperlukan aplikasi Anda, baca Mendukung Versi Platform Yang Berbeda.

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