24

Is it possible to submit an app to the new TestFlight via iTunes Connect using the "Development" environment for CloudKit?

It seems that only AdHoc Provisioning Profiles ask for the preferred CloudKit container name (Production or Development) when doing an "Export" from Organizer, however AdHoc Provisioning profiles do not contain the "beta-reports-active" entitlement required to submit apps to iTunes Connect and allow TestFlight use.

SO it would seem if you want to use the new iTunes Connect version of TestFlight to test your CloudKit-based app, you have to use the Production environment. Has anyone else had this issue?

3 Answers 3

25

I have also tried to do that, but I don't think it is possible. TestFlight is primarily for apps "that you intend for public release on the App Store." If you are beta testing with iTunes users, Apple expects you to be using the Production server, as the users will expect their content to survive over to the released product.

Personally, I just decided to switch to Production when I started using TestFlight. If you are just testing with internal users, then you still have the option of Ad Hoc distribution, which as you point out allows you to use either server.

By the way, you can change the server locally, so you can test Production from your debug builds.

The documentation states:

At runtime, CloudKit uses your app’s com.apple.developer.icloud-container-environment entitlement to discover whether you are using a Development or Production version of your provisioning profile.

So you can add this to your entitlements to set it to Production or Development:

<key>com.apple.developer.icloud-container-environment</key>
<string>Production</string>

You could try setting this field to Development and then pushing to iTunes Connect, but I'm guessing that Xcode will overwrite it during the upload to force you to use Production.

10
  • 1
    I did try the entitlements suggestion and uploaded to iTunes TestFlight, however the build had a badge on it indicating it could not be used. Thanks for the help though!
    – nh32rg
    Nov 18, 2014 at 21:12
  • 1
    Great! Thanks! Works for me to switch to Prod environment with debug
    – AlKozin
    Dec 2, 2014 at 10:24
  • That doesn't work for me. In my archived-expanded-entitlements.xcent I switch from <key>com.apple.security.app-sandbox</key> <true/> to <key>com.apple.developer.icloud-container-environment</key> <string>Production</string> and still pointing to SandBox Dec 8, 2014 at 18:10
  • @user2924482 The app sandbox is different from the iCloud environment. App sandbox refers to the fact that your app can only access files that belong to it. All iOS apps are always sandboxed, no matter what. The iCloud environment has nothing to do with that - it refers to which server the app talks to: the development server or the production server. Dec 8, 2014 at 21:25
  • 1
    You can only make additive changes to production. You cannot delete or rename things in production. But this is exactly what Apple wants before you use TestFlight. They don't want you shipping code to their customers that you break later. Apr 2, 2018 at 18:53
10

It looks like this is not possible.

"Note that apps distributed via TestFlight or the store can’t use the development environment." https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/CloudKitQuickStart/TestingYourApp/TestingYourApp.html

However, you can point to Production while you're debugging the app through Xcode by setting: com.apple.developer.icloud-container-environment to "Production" in your entitlements file.

1
  • 1
    Thank you; I didn't realize that I needed to switch to the Production environment even for internal beta testing.
    – AmitaiB
    Apr 9, 2017 at 1:49
-1

Actually you can follow this documentation and you use sandbox to test your app:

apple documentation

1
  • That link now redirects to an "archive" document, which says "Instruct [your testers] to install the app on their devices using iTunes", but iTunes no longer exists.
    – Graham Lea
    Jul 12 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.