Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 812
Snuggles-With-Bunnies Avatar asked May 30 '17 19:05

Snuggles-With-Bunnies


1 Answers

Use

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

And set method = developer-id exportOptions.plist.

like image 123
Yoav Avatar answered Oct 07 '22 20:10

Yoav