Hello,
I am building an multiplatform app for iOS and macOS that uses CloudKit. I want give prerelease versions of my app to testers in my team. I want those builds to use the CloudKit development environment, as some of the schema is still experimental and subject to breaking changes. However, when I distribute my app via TestFlight, the iCloud container environment is automatically set to production, even though in my entitlements file I've set the iCloud container environment to development. I also tried the 'Release Testing' distribution method, but also with this option the container environment is overridden and set to production.
Does anyone know how I can distribute a release build for internal testing that uses the CloudKit development environment?
You can try the Custom distribution option. Concretely:
-
In Xcode, archive your app by clicking
Product>Archive, which brings up theArchiveswindow, if your project builds correctly. -
Select the archive, and then
Distribution App. -
Select
Custom, and thenNext. -
Select
Release Testing, which allows you to create an Ad Hoc version for testing, and thenNext.
There you can pick the iCloud environment. It is default to Production, and you can change it to Development.
I am using Xcode 27.0 beta 5 and so the UI may be slightly different, but the option that allows selecting iCloud environment for Ad Hoc distribution has been there.
I don't see any way to change the iCloud environment for TestFlight distribution. If I remember correctly, we used to respect the value of the com.apple.developer.icloud-container-environment entitlement in your project. It's not the case any more with today's tool.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.