title: Modifying Info.plist's CFBundleVersion in Xcode 5 with Asset Library enabled
body: <p>With Xcode 5's new Asset Library, adding images and organizing them has never been easier. However, it seems as if it has broken some scripts I use for creating builds.</p>
  
  <p>I have a script within my Run Script Phase that sets the <code>CFBundleVersion</code> to be the current timestamp within the plist. In the script, I execute this statement:</p>
  
  <pre><code>/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $timestamp" $BUILT_PRODUCTS_DIR/$INFOPLIST_PATH
  </code></pre>
  
  <p>However, when this gets executed, the following statement displays:</p>
  
  <pre><code>Set: Entry, ":CFBundleVersion", Does Not Exist
  File Doesn't Exist, Will Create: /Users/SpacePyro/Library/DerivedData/BundleTest-duikdqngfmrovnagrcsvdcuxxstz/Build/Products/Debug-iphoneos/BundleTest.app/Info.plist
  </code></pre>
  
  <p>It seems like this happens on clean builds. The plist doesn't seem to get generated until midway through the build, presumably due to the Asset Libraries. </p>
  
  <p>I've also used this command, and while it doesn't throw the error, it still blows away my changes (assume <code>INFO_PLIST="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Info"</code>):</p>
  
  <pre><code>defaults write $INFO_PLIST CFBundleVersion $timestamp
  </code></pre>
  
  <p>This used to not be the case when I started using the Asset Library to organize my app icons and splash images. Anyone know why this happens? And better yet, is there a workaround to add this value to the plist? I've already tried placing the script in a pre-action build phase, as well as the post-action build phase. I've also tried running the command after the build has completed, but when I try to codesign and package it up, it says that the signature is invalid due to plist modification.</p>
  
  <p>If no reasonable solution exists, I guess I could always de-migrate from Asset Libraries until I can get my scripts to work.</p>