Skip to content

Instantly share code, notes, and snippets.

@cbowns cbowns/craziness.sh
Created Aug 16, 2017

Embed
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>" ];
then
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
else
echo 0
fi
done
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.