Testing on Android

Test your PurchaseKit integration with license testers and internal testing tracks.

License testers

License testers can make purchases without being charged. This is the easiest way to test during development.

Add license testers

  1. Open Google Play Console
  2. Go to Setup → License testing
  3. Add the email addresses of your test accounts
  4. Click Save changes

License testers must use the same Google account on their test device.

Internal testing track

For full end-to-end testing with real Play Store downloads:

  1. In Play Console, go to Testing → Internal testing
  2. Click Create new release
  3. Upload your APK or AAB
  4. Click Save and then Review release
  5. Click Start rollout to Internal testing

Add testers

  1. Go to Testing → Internal testing → Testers
  2. Create a new email list or use an existing one
  3. Add tester email addresses
  4. Copy the Join on the web link and share with testers

Testers must accept the invite and install from the Play Store to test purchases.

Testing webhooks locally

To test real Google Play webhooks locally:

  1. Expose your local Rails app with Cloudflare Tunnel:
    bash
    cloudflared tunnel --url http://localhost:3000

  2. In the PurchaseKit dashboard, set your app's Sandbox Webhook URL to your tunnel URL:

    https://example-tunnel.trycloudflare.com/purchasekit/webhooks

  3. Make a test purchase with a license tester account

  4. Watch the webhook arrive in your Rails logs

Test vs production purchases

Google Play doesn't have a separate sandbox environment like Apple. Instead:

  • License testers make test purchases that don't charge their payment method
  • Non-testers make real purchases that are charged

PurchaseKit detects test purchases via Google's testPurchase flag and marks them as sandbox environment.