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
xcodebuild archive \
-project $xcodeproj.xcodeproj \
-scheme $xcodeproj \
-archivePath $xcodeproj.xcarchive \
CODE_SIGN_IDENTITY="$common_name"
xcodebuild -exportArchive \
-archivePath $xcodeproj.xcarchive \
-exportPath $xcodeproj \
-exportFormat ipa \
-exportProvisioningProfile "$provisioning_profile"
/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.
Questions:
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