Skip to content

Instantly share code, notes, and snippets.

@ericholsinger
ericholsinger / xcode-build-number-increment-phase
Created December 12, 2013 18:04
This is a script for incrementing build numbers in xcode, automatically during the build phase. It handles the build in the format xx.yy.zz where zz is incremented for each build, and yy is incremented when you archive your project. The xx is handled manually in this case. For more information, you can read my blog post at http://bit.ly/1h3ztJK
#!/bin/bash
conf=${CONFIGURATION}
arch=${ARCHS:0:4}
# Only increase the build number on Device and AdHoc/AppStore build
if [ $conf == "Release" ]
then
echo "Bumping bundle version number..."
buildPlist=${INFOPLIST_FILE}
bundleVersion=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$buildPlist" | /usr/bin/perl -pe 's/(\d+\.)(\d+)(\.\d+)/$1.($2+1).$3/eg'`
@shazron
shazron / sim-run.sh
Created October 25, 2011 21:53
Run Xcode Simulator project from the command line
#!/bin/bash
#
# Build and iPhone Simulator Helper Script
# Shazron Abdullah 2011
#
# WARN: - if your .xcodeproj name is not the same as your .app name,
# this won't work without modifications
# - you must run this script in where your .xcodeproj file is
PROJECTNAME=$1