title: How to auto increment build number in Xcode
body: <p>I found many solutions and scripts on this site, but the easiest solution to increase the build number in Xcode is:</p>
  
  <p>Go to Build Phases in your TARGETS section and add Run Script Build Phase:</p>
  
  <p><img src="https://i.stack.imgur.com/VV8bX.png" alt="Auto increment build numbers in xcode"></p>
  
  <p>Change Shell to /bin/bash and insert the following script:</p>
  
  <pre><code>#!/bin/bash
  buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
  buildNumber=$(($buildNumber + 1))
  /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
  </code></pre>
  
  <p>Have fun! :)</p>
  
  <p><a href="http://cocoafactory.com/blog/2013/03/18/auto-incrementing-xcode-build-numbers/" rel="noreferrer">I found this tutorial on Cocoa Factory</a></p>