简体   繁体   English

如何使用调试APK测试Android Pay?

[英]How to test Android Pay with a debug APK?

By default, Android Pay refuses to work in debug builds, which makes testing tricky. 默认情况下,Android Pay拒绝在调试版本中工作,这使测试变得棘手。 What we've done so far is to actually merge new code into a develop or hotfix branch so our build environment will make a signed APK which can be tested. 到目前为止我们所做的是将新代码实际合并到开发或修补程序分支中,这样我们的构建环境就会生成一个可以测试的签名APK。 This is not ideal. 这不太理想。

https://developers.google.com/android-pay/get-started states "Note: Our test environment will not return live, chargeable tokens in the FullWallet response, but will allow us to test your pre-purchase flow. You will see an Unrecognized App error on the Android Pay chooser until your app has production access." https://developers.google.com/android-pay/get-started states“注意:我们的测试环境不会在FullWallet响应中返回实时,可收费的令牌,但会允许我们测试您的预购流程。您将在您的应用具有生产访问权限之前,请在Android Pay选择器上看到无法识别的应用错误。“ which isn't too promising. 这不太有希望。

https://developer.android.com/google/play/billing/billing_testing.html suggests testing with specially configured static responses for "reserved product IDs", which would be a nuisance to set up and not a true test. https://developer.android.com/google/play/billing/billing_testing.html建议使用针对“保留产品ID”的特殊配置静态响应进行测试,这对设置而非真正的测试非常麻烦。 The other option they offer is to publish the app to an alpha or beta channel, which would, of course, be a signed APK. 他们提供的另一个选择是将应用程序发布到alpha或beta频道,当然,这将是一个签名的APK。 https://stripe.com/docs/mobile/android has a suggestion about "TEST_GATEWAY_TOKEN" but isn't really helpful in learning how to use Android Pay in test. https://stripe.com/docs/mobile/android有关于“TEST_GATEWAY_TOKEN”的建议,但在学习如何在测试中使用Android Pay方面确实没有帮助。

We even talked to a Google Developer Advocate, who did nothing but cut and paste some of the same documentation. 我们甚至与Google Developer Advocate进行了交谈,他们除了剪切和粘贴一些相同的文档外什么都没做。

Is there any way to do a good test using an unsigned build? 有没有办法用无符号构建做一个好的测试? It would be wonderful to test Android Pay functionality successfully on a local developer machine. 在本地开发人员计算机上成功测试Android Pay功能会很棒。

No, there is not a debug mode option to that per docs: 不,每个文档都没有调试模式选项:

https://developer.android.com/google/play/billing/billing_testing.html https://developer.android.com/google/play/billing/billing_testing.html

set a separate machine with a CI server and have it do the alpha and beta builds for testing Google Play. 设置一个单独的机器与CI服务器,并让它做alpha和beta版本测试谷歌播放。

It is a pity but you have only one way to test IAP: 遗憾的是你只有一种方法可以测试IAP:

  1. Grant testing permission to your google accout used at your device 授予您在设备上使用的Google帐户的测试权限
  2. Build .apk file. 构建.apk文件。
  3. Upload it to your account at GoolePlay as beta version 将其作为测试版在GoolePlay上传到您的帐户
  4. Wait until uploaded .apk processed 等到上传.apk处理完毕
  5. Try do to actions you need and check it. 尝试执行您需要的操作并进行检查。
  6. If any issues - fix them and start from p. 如果有任何问题 - 修复它们并从p开始。 2 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM