As of the release of iOS11 it has been a pain (if not impossible) testing in-app purchases. While I've found a great workaround for testing on iOS here: https://stackoverflow.com/a/46467498/4514671 I could not find anything for macOS apps.
So here is what I did that kind of does the same as with the iOS workaround:
- In the App Store app Sign Out of your account (Store/Sign Out)
- In iTunes Connect create a brand new Tester
- Restart your computer
- Open your Xcode project
- Build & run
- Click on your Buy button to start a purchase
- Sign in with your newly created test account
- When prompted to Change the store click on Cancel
- Click on your Buy button to start a purchase again and the correct Buy Alert will pop up; finish the transaction by actually making the purchase
Done! Hours of frustration saved! Thanks Apple :[
来源:https://stackoverflow.com/questions/46592844/cannot-test-in-app-purchases-in-xcode-9-for-macos-app