So I'm trying to update a bunch of build scripts for our Mac Apps to no longer be tied to using Xcode 8.2.1 and the obsolete -exportFormat PKG arguments.and use the modern -exportOptionsPlist options instead.
According to xcodebuild -h:
method : String
Describes how Xcode should export the archive. Available options: app-store, ad-hoc, package, enterprise, development, developer-id, and mac-application. The list of options varies based on the type of archive. Defaults to development.
i.e previously I had something like this
xcodebuild -exportArchive -exportFormat PKG -archivePath MyApp.xcarchive -exportPath "Install MyApp.pkg" -exportSigningIdentity "MySigingingId"
I've created an export options plist like this:
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>method</key>
<string>package</string>
</dict>
</plist>
and am now calling:
xcodebuild -exportArchive -archivePath MyApp.xcarchive -exportPath "Install MyApp.pkg" -exportOptionsPlist ExportPackage.plist
But that gives the following error:
exportArchive: exportOptionsPlist error for key 'method': expected one of {app-store, developer-id, development, mac-application}, but found package
So I am guessing exporting packages from the xcodebuild -exportArchive is not really supported anymore and I'll just have to convert all my scripts to export the app first and then run pkgbuild to create the installer. Am I correct? If so I'll raise a bug report that xcodebuild -h is wrong in saying 'package' is allowed for the 'method' property.