I'm busy working on a Jenkins build that will be building iOS applications. I have managed to create an archive successfully with this command:
xcodebuild archive -archivePath build/app.xcarchive
Now I'm trying to export that archive with specifying the output file name, but can't get this to work.In the example below I want an output file called app.ipa, but all I get is a folder called app.ipa with an ipa file inside name .ipa
xcrun xcodebuild -exportArchive -exportPath build/app.ipa -archivePath build/app.xcarchive/ -exportOptionsPlist exportOptions.plist
Outputs a file /build/app.ipa/<projectname>.ipa
Apples documentation for XCodeBuild says that you can specify the output path including file name:
-exportPath destinationpath Specifies the destination for the exported product, including the name of the exported file.
https://web.archive.org/web/20170620204608/https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
The reason for this is that I would like to keep the build generic so that any project I send through it will result in an app.ipa without me needing to keep track of project names and different output files etc.
This is filed as a bug in open radar: "xcodebuild exportArchive -exportPath" does not write what it's documented to write
For XCode 11 and earlier:
ArchiveAction tag in .xcscheme file can have attribute customArchiveName which can be set to anything you like.
<ArchiveAction
buildConfiguration = "AdHoc_Example"
customArchiveName = "app"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
This will give you app.ipa
always when you export the archive through -exportOptionsPlist
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With