title: Better way of incrementing build number?
body: <p>I have been using a shell script as part of my Xcode build process to increment the build number within the <em>plist</em> file, however it's making Xcode 4.2.1 crash frequently (with an error about the target not belonging to a project; I'm guessing the changing of the <em>plist</em> file is confusing Xcode in some way).</p>
  
  <p>The shell script did this so that the build number is only incremented by <code>agvtool</code> when a file is newer than the <em>plist</em> file (so just building didn't increment the value):</p>
  
  <pre><code>if [ -n \"`find ProjDir -newer ProjDir/Project-Info.plist`\" ]; then agvtool -noscm next-version -all; else echo \"Version not incremented\"; fi
  </code></pre>
  
  <p>Is there a way to increment the build number (in the <em>plist</em> file, or anywhere else) that doesn't break Xcode?</p>
  
  <p><strong>FINAL EDIT</strong>:  I now do this kind of stuff using a python script which I have just made public on <a href="https://github.com/trojanfoe/xcodedevtools" rel="noreferrer">github</a>.  It's not well documented but shouldn't be difficult to work out.  As a bonus this repo also contains a useful script to automatically bundle 3rd party library into an app bundle. </p>