Skip to content

Instantly share code, notes, and snippets.

@cbowns cbowns/
Created Aug 16, 2017

What would you like to do?
Rename your iOS archives to include the app's version and build number
# Pardon the craziness:
# Given a directory of `*.xcarchive`s:
# enter your app's name for "<App name>", if you have a folder of
# heterogenous archives to process:
for dir (*); do
name=`defaults read "\`pwd\`"/$dir/Info.plist Name`
if [ "$name" = "<App name>" ];
echo "$dir:"
name=`defaults read "\`pwd\`"/$dir/Info.plist Name`
version=`defaults read "\`pwd\`"/$dir/Info.plist ApplicationProperties | grep -i CFBundleShortVersionString | sed 's/;//g' | sed 's/.* =//g' | sed 's/"//g' | awk '{$1=$1};1'`
build=`defaults read "\`pwd\`"/$dir/Info.plist ApplicationProperties | grep -i CFBundleVersion | sed 's/;//g' | sed 's/.* =//g' | sed 's/"//g' | awk '{$1=$1};1'`
echo "moving to $name - $version - build $build - $dir"
mv $dir "$name - $version - build $build - $dir"
echo 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.