I am using latest XCode 8.2.1 and try to upload my application for testing to iTunes Connect to share it with TestFlight.
I am using "Automatic Code Signing" in "General" settings. I am able to deploy my application on a connected iOS device.
What I have tried:
In XCode I choosed "Product => Archive" and then I selected "Save for Development Deployment". I have also created a "manifest.plist" to share the ipa file over a special web page.
This step is processed successfully and I have a valid ipa file for sharing. The sharing is also working when a known device want to install the application over the air on a special web page "manifest.plist" (https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/Introduction/Introduction.html)
- To upload the ipa file to iTunes Connect I choose "XCode => Open Developer Tool => Application Loader".
- In opened window I click on "Choose" and select the created ipa file from archive exporting process.
The Issue
This step returns with the error message: "ERROR ITMS:90161: 'Invalid Provisioning Profile: The provisioning profile included in the bundle xxx.xxx is invalid. (Missing code-signing certificate). A Distribution Provisioning Profil should be used when submitting apps to the App Store. Bla bla"
From another answer I know:
"In Xcode 8, Automatic Signing is going to manage profiles, entitlements and certificates for you, but only for Development. If you select automatic, you are forced to use Development signing and Xcode-created provisioning profiles.
On the WWDC 2016 (Session 401 - What's new in Xcode app signing) they explain this new signing method and describe some 'Best Practices'. When you are building for distribution and using Automatic Signing or Manual you should Archive for Development and then export (from the organizer or the command line tools xcodebuild -exportArchive) as Distribution. The organizer will re-sign your app for Distribution even if it was archived for Development." (Xcode 8.0 Automatically Manage Signing behaviour)
Question
How to force the organizer or what ever to sign the app with the Distribution Profile? Of cource there is one in Apple Developer Account but it seems that XCode 8 is not able to select it.