Siri, please xcodearchive this project
- Siri, please, tell Xcode to archive this project, and upload it to the AppStore.
- Yes, master.
- One moment please.
- It’s done. Would you like me to upload the IPA to iTunes Connect as well?
- Yes. Thank you.
The dialog above would be nice, but, we are not far enough in the future. You can use the command line to control Xcode, but Apple only provides the command xcodebuild, to build a project. There is nothing to save an IPA.
There are many scripts on the net to generate an IPA, but most of them where destined to be added as a script to be run by Xcode at the end of the Build process.
I wanted something more project agnostic, that didn’t require a configuration to be used.
I wrote a script named xcodearchive. Think of it as xcodebuild for archiving.
To use it, it is as simple as typing:
$ xcodearchive
It will automatically generate an IPA, save it on your Desktop.
By default, it also archive your dSYM symbols (you always keep them, right?).
It will do the same with your debug symbol, in a file named with enough details when you will need it a few weeks later, for example: AwesomeApp_version_1.3_20120114_17h54_dSYM_symbols.zip
It automatically reads your settings from your Xcode project. You can override some of them, if you need to.
Why is it better than using Xcode GUI?
It’s not, it is just different. …ok, it is better: more efficient, more options, which equals to a developer more happy with more time to do what is important, be it having some drinks with friends or polishing that ultimate detail of the already awesome application.
The code -in ruby- is available on github: xcodearchive
I have only tested it on an iPhone project. If you want to add support to Mac projects, I would be happy to receive a pull request.


Indeed there is a Tool to build ipa files, it is hidden behind xcrun
/usr/bin/xcrun -sdk iphoneos PackageApplication -v “$PRODUCT_PATH” -o “$IPA_FILE” –sign “$DISTRIBUTION_CERTIFICATE” –embed “$PROVISIONING_PROFILE_PATH”
Oh well never mind, you’re using it in your ruby script