Why is IPA signed with development profile when signing identity is Apple Distribution?

The CODE_SIGN_IDENTITY in the project settings is "Apple Distribution" (for the Release configuration), and I have the distribution certificate in the keychain. But the embedded.mobileprovision file in the .ipa shows only development certificates - why? How can we build a distribution-ready app with xcodebuild?

xcrun xcodebuild \
  -project MyApp/MyApp.xcodeproj \
  -scheme MyApp \
  -configuration Release \
  -sdk iphoneos \
  -destination "generic/platform=iOS" \
  -quiet \
  archive \
	-archivePath MyApp/Build/Applications/MyApp.xcarchive \
	-allowProvisioningUpdates \
	-authenticationKeyPath $(APPLE_DEV_KEY_PATH) \
	-authenticationKeyID $(APPLE_DEV_KEY_ID) \
	-authenticationKeyIssuerID $(APPLE_DEV_ISSUER_ID) \
	DWARF_DSYM_FOLDER_PATH=Build/Applications
Answered by alpe77 in 725485022

It was because the exportOptions.plist method was set to development. Set it to app-store, and it will sign with a distribution profile.

FWIW, the Provisioning Profile under Build Settings is also Automatic. I tried adding CODE_SIGN_IDENTITY="Apple Distribution" to the xcodebuild command, but that failed with "MyApp is automatically signed for development, but a conflicting code signing identity Apple Distribution has been manually specified".

Accepted Answer

It was because the exportOptions.plist method was set to development. Set it to app-store, and it will sign with a distribution profile.

Why is IPA signed with development profile when signing identity is Apple Distribution?
 
 
Q