title: continuous integration with XCode bots and cocoapods
body: <p>I'm having problems with bots occasionally failing when building.
  A pre build action is used to install the pods, this works well some times. However when the integration fails it's because of this error:</p>
  
  <pre><code>Installing Pods
  Analyzing dependencies
  Downloading dependencies
  [32mInstalling AFNetworking (1.3.3)[0m
  ...
  2014-03-07 10:40:25.667 xcodebuild[76637:100b] [MT] IDEFileReferenceDebug: [Load] &lt;IDEFileReference, 0x7fa3fe5b0840: group:Pods/Pods.xcodeproj&gt; Failed to load container at path: /Library/Server/Xcode/Data/BotRuns/Cache/5bbd629b-a843-42b0-8b52-256db7560be5/source/Pods/Pods.xcodeproj, Error: Error Domain=Xcode3ProjectErrorDomain Code=2 "Project /Library/Server/Xcode/Data/BotRuns/Cache/5bbd629b-a843-42b0-8b52-256db7560be5/source/Pods/Pods.xcodeproj cannot be opened because it is missing its project.pbxproj file." UserInfo=0x7fa3fe7e54b0 {NSLocalizedDescription=Project /Library/Server/Xcode/Data/BotRuns/Cache/5bbd629b-a843-42b0-8b52-256db7560be5/source/Pods/Pods.xcodeproj cannot be opened because it is missing its project.pbxproj file.}
  Generating Pods project
  Integrating client project
  </code></pre>
  
  <p>So my guess is that xcodebuld tries to read the Pods-project before it's done being generated. </p>
  
  <p>Does this sound like a reasonable guess? </p>
  
  <p>And would anyone know how to solve it?</p>
  
  <p><strong>EDIT</strong>
  Pre-action build script looks lie this</p>
  
  <pre><code>cd $SRCROOT
  
  export LC_ALL="en_US.UTF-8"
  
  if [ -d Pods ]
  then
  echo "Updating Pods"
  pod update
  else
  echo "Installing Pods"
  pod install
  </code></pre>