Snuggles-With-Bunnies
Snuggles-With-Bunnies

Reputation: 111

Exporting as macOS app using xcodebuild

I have a build script that exports an OS X app to a .app file. This is the equivalent of going into xcode and archiving, then choosing export, then choosing the 'Export as a macOS App'. The script used to work just fine, until the -exportFormat flag was removed from xcodebuild. Now the script does not work at all. I have not had any luck determining what the new flags should be.

I have looked into the -exportoptionsplist flag, but I don't know what to put in my plist, or if this is even the correct solution. The relevant lines from the script are below:

#Archive the app
xcodebuild -workspace '/path/project.xcworkspace' -config Release -scheme 'Some Scheme' -archivePath ./archive archive

#Export the archive as in the APP format
xcodebuild -archivePath archive.xcarchive -exportArchive -exportPath 'exportedApp.app' -exportFormat App

How can I get result that -exportFormat App used to provide?

Upvotes: 9

Views: 3605

Answers (1)

Yoav
Yoav

Reputation: 6108

Use

xcodebuild \
-archivePath archive.xcarchive \
-exportArchive -exportPath 'exportedApp.app'\
-exportOptionsPlist exportOptions.plist

And set method = developer-id exportOptions.plist.

Upvotes: 4

Related Questions