Reputation: 1814
I have an OS X app that contains a Network Extension bundle (VPN), which requires extended "Network Extension" entitlements that I specify when I create a provisioning profile (your team has to be authorized by Apple for this option to show up in their dev portal). So I have to manage provisioning profiles manually, rather than let Xcode handle everything, because the auto-generated "Managed by Xcode" profiles don't contain the extended entitlements. I use the PROVISIONING_PROFILE setting in my project to specify the correct ones.
When exporting my app from an xcarchive...
xcodebuild -exportArchive -archivePath path_to_xcarchive -exportPath $OUTDIR -exportOptionsPlist exportOptions.plist
xcodebuild embeds in my .app the auto-generated profiles rather than the profiles specified in my build settings. I've looked at the .app inside the .xcarchive and it does contain the correct profiles, but xcodebuild swaps them out on export. I see the same issue when exporting via Xcode's UI - I'm shown the profiles that will be used for the export, and they're the wrong ones, with no way to change them.
Anyone know how to prevent the use of managed profiles, or force Xcode to use specific ones?
Upvotes: 3
Views: 2619
Reputation: 1814
Xcode 9 -exportOptionsPlist now supports specifying certs and profiles via signingStyle, a signingCertificate, and provisioningProfiles options.
<key>signingStyle</key>
<string>manual</string>
<key>provisioningProfiles</key>
<dict>
<key>com.your.bundleid</key>
<string>Name of provisioning profile for app</string>
<key>com.your.bundleid.extension</key>
<string>Name of provisioning profile for extension</string>
</dict>
<key>signingCertificate</key>
<string>iOS Distribution</string>
Upvotes: 7