我们可以在模拟器中测试Apple pay吗

Can we test Apple pay in simulator

我知道 Apple pay 测试我们在 iOS 8 中使用 Apple pay 存根,但请告诉我如何在模拟器中 iOS 9 中使用没有 Apple PayStubs 的 Apple pay。

提前致谢

是的。您可以使用 iOS 9 模拟器测试 apple pay。所以你不需要添加任何测试 sheet 而不是 PKPaymentAuthorizationViewController。它在 iOS 9 模拟器上工作。确保您的应用程序 运行 在 iPhone 6、iPhone 6 plus 或最新版本的模拟器上。

是的,它在模拟器中与 Xcode 7 和 iOS 9 一起工作。

无需生物识别拇指扫描。

谢谢大家

官方文档:https://developer.apple.com/library/archive/ApplePay_Guide/Authorization.html

NOTE

In Xcode 7.0 or later, you can test the payment authorization view controller in the simulator. It provides simulated cards for all the supported payment networks and returns dummy payment data in plain text. On a device, this data is encrypted with your merchant identifier and must be decrypted either on your server or by your payment processor.

Use the Apple Pay Sandbox environment to test your app on a device with test cards.

Although these techniques provide fast and convenient ways to test your code, you still need to thoroughly test Apple Pay on actual, physical devices with production cards.

在 Xcode 12.5 和 iOS 14.5 中,您可以使用

opt + cmd + A