Use production CloudKit during development? Use production CloudKit during development? ios ios

Use production CloudKit during development?


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 with value: Production.Note: Will not work with simulator

enter image description here


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.