XcodeBuild -exportArchive will not let me specify a file name

I'm busy working on a Jenkins build that will create iOS apps. I managed to create an archive with this command:

xcodebuild archive -archivePath build/app.xcarchive 

Now I am trying to export this archive with the name of the output file , but cannot make it work. In the example below, I need an output file called app.ipa, but all I get is a folder called app.ipa with an ipa file inside the name .ipa

 xcrun xcodebuild -exportArchive -exportPath build/app.ipa -archivePath build/app.xcarchive/ -exportOptionsPlist exportOptions.plist Outputs a file /build/app.ipa/<projectname>.ipa 

The apple documentation for XCodeBuild says that you can specify the output path, including the file name:

-exportPath path Specifies the destination for the exported product, including the name of the exported file.

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html

The reason for this is that I would like to save the assembly generator so that any project that I submit through it would lead to app.ipa without me to keep track of project names and different output files, etc.

+6
source share
3 answers
+5
source

The ArchiveAction tag in the .xcscheme file can have a customArchiveName attribute that can be customized to whatever you like.

  <ArchiveAction buildConfiguration = "AdHoc_Example" customArchiveName = "app" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme> 

This will give you app.ipa whenever you export the archive via -exportOptionsPlist .

+4
source

If you execute xcodebuild --help , it says:

 -exportPath PATH specifies the destination for the product exported from an archive 

Mmm.

To make a workaround, you can subsequently rename your file.

 mv "oldname" "newname" 
+2
source

All Articles