unit and acceptance testing, automation, productivity

Packaging an ipa with Swift files from the terminal

One day I saw this tweet from my friend Marco Sero

It looked liked something I should have take note of. So I obviously forgot about it.

Some days ago I set up the automated build distribution pipeline for a new client, with an app using a bit of Swift. I usually use something similar to this script. It is a pretty battle tested script, but something when wrong.

And that's when I remembered Marco's tweet and phatblat's script.

Download the raw script from here, place it somewhere, maybe in the project's root, then simply replace the xcodebuild -exportArchive command with:

bin/ "$archive_path" "$(pwd)/$ipa_path"

Notice the $(pwd) in the second argument. That's because the script is expecting absolute paths, while mine uses relative ones.

Leave the codebase better than you found it.

Vote on Hacker News