Search code examples
iosxcodejenkinstestflight

Which Certificate Type and Provisioning Profile Type should I use for Test Flight


We are setting up a Continuous Deployment server with a MacOS-node for iOS-builds. The build itself is working correctly. However, we have difficulties in signing the app. As we want to do testing within a dynamically growing test-pool, we're currently using TestFlight (integrated into iTunesConnect). This is currently done via XCode-GUI and is working perfectly fine. As we want to move the manual process to CD-server, this needs to be done via command line.

Currently what is there so far

  • building & archiving

xcodebuild archive \ -project $xcodeproj.xcodeproj \ -scheme $xcodeproj \ -archivePath $xcodeproj.xcarchive \ CODE_SIGN_IDENTITY="$common_name"

  • exporting to ipa-file

xcodebuild -exportArchive \ -archivePath $xcodeproj.xcarchive \ -exportPath $xcodeproj \ -exportFormat ipa \ -exportProvisioningProfile "$provisioning_profile"

  • validation

/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool \ --validate-app \ -f $build_dir_ios/project/$ipa_file \ -u $testflight_user \ -p $testflight_pass

However, the validation tells me that my provisioning profile is incorrect. The response of the validation is as follows.

2015-12-04 18:53:30.308 altool[63218:8786237] *** Error: Unable to validate archive '/Users/deploy/jenkins/workspace/***/build/ios/project/***.ipa': ( "Error Domain=ITunesConnectionOperationErrorDomain Code=1176 \"Unable to process application at this time due to the following error: Invalid Provisioning Profile. The provisioning profile included in the bundle *** [Payload/***.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal..\" UserInfo=0x************ {NSLocalizedRecoverySuggestion=Unable to process application at this time due to the following error: Invalid Provisioning Profile. The provisioning profile included in the bundle *** [Payload/***.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal.., NSLocalizedDescription=Unable to process application at this time due to the following error: Invalid Provisioning Profile. The provisioning profile included in the bundle *** [Payload/***.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal.., NSLocalizedFailureReason=iTunes Store operation failed.}"

As this failure is probably certificate / provisioning profile based, that's how we created the two of them.

  1. login to https://developer.apple.com as admin
  2. go to Certificates, Identifiers & Profiles
  3. add a new certificate of the type iOS App Development, which will later on be displayed as iOS Development
  4. add a new provisioning profile connected to a certain app-version of the type iOS App Development, which will later on be displayed as iOS Development

Questions:

  1. Which certificate / certificate type should be used here?
  2. Which provisioning profile should be used here?
  3. How to later on push the app only for TestFlight via command line?

Solution

  • 1/ A Distribution one

    2/ An App Store one

    3/ You cannot, except if you use tools like https://github.com/fastlane/fastlane (pilot)

    Good luck

    Nicolas