Use production CloudKit during development?

谁说胖子不能爱 提交于 2019-11-29 19:46:53
RawMean

Add the following entry to your entitlements file and perform a clean build.

This allows you to run your application in Xcode with the cloudKit in the production mode.

Entry to add: com.apple.developer.icloud-container-environment

From the iCloud Design Guide https://developer.apple.com/library/mac/documentation/General/Conceptual/iCloudDesignGuide/DesigningforCloudKit/DesigningforCloudKit.html#//apple_ref/doc/uid/TP40012094-CH9-SW1

During development, Xcode automatically points your app to the development environment. Before you ship your app, configure your app using the distribution workflow. In this workflow, Xcode lets you choose whether you want to target the development or production environment and adds the com.apple.developer.icloud-container-environment entitlement to your app with the value you selected. Prior to shipping, be sure to configure your app for the production environment. Apps that target the development environment will be rejected by the App Store.

Per you comment here are some additional thoughts: Per Apple guideline, you should use the development env as long as you are still developing what is the best Data Schema for your application, and to allow faster development. Then Apple suggests to deploy to production and test on it, before giving to customer. So I think the answer is that it depends on where you are in the product development cycle. If you are in early stages use the dev env. If you have customers in the field then I would use the production env for production as long as it serves my needs. If I am developing new features requiring schema changes you should only develop those in the dev env until you are confident deploying them to production will not break anything for existing users and allow them a smooth transition. Hope this help.

I am not sure whether setting "the com.apple.developer.icloud-container-environment entitlement" to "Production" will work on a device running from Xcode - it doesn't work for me on the simulator.

But you could make yourself an 'internal reviewer' and run a new version using TestFlight. TestFlight uses the Production Environment.

In addition to com.apple.developer.icloud-container-environment. I found that the production cloud did not work to start with. I checked the logs in the dashboard and could see errors. It was only when I deployed the development settings to the production did it work. It looks like the dev one will automatically create the new settings but the production one does not. Perhaps I should be doing more programmatically from the app to set things up but I hope this information helps.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!