Distributing release build using CloudKit dev environment

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?

Answered by DTS Engineer in 902520022

You can try the Custom distribution option. Concretely:

  1. In Xcode, archive your app by clicking Product > Archive, which brings up the Archives window, if your project builds correctly.

  2. Select the archive, and then Distribution App.

  3. Select Custom, and then Next.

  4. Select Release Testing, which allows you to create an Ad Hoc version for testing, and then Next.

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.

For context, I'm using Xcode 26.6.

You can try the Custom distribution option. Concretely:

  1. In Xcode, archive your app by clicking Product > Archive, which brings up the Archives window, if your project builds correctly.

  2. Select the archive, and then Distribution App.

  3. Select Custom, and then Next.

  4. Select Release Testing, which allows you to create an Ad Hoc version for testing, and then Next.

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.

Distributing release build using CloudKit dev environment
 
 
Q