title: xcode build fails with error code 65 without indicative message
body: <p>I'm experiencing weird behaviour with my iPhone CI job (running in TeamCity). Every once in a while our build fails without any indicative error in the build log. The build reaches the last stage of codesign validation and I get <code>** BUILD FAILED **</code> message immediately after.</p>
  
  <p>These are the last lines of the log of a good and bad builds -</p>
  
  <pre><code>Bad Build
  [15:00:56] :             [CodeSign]     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Library/TeamCity/buildAgent/work/dc055fa257f562be/DerivedData/MyProject/Build/Products/AdHoc-iphoneos/MyProject.app
  [15:00:58]W:     [Step 3/6] ** BUILD FAILED **
  
  Good Build
  [14:09:13] :             [CodeSign]     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Library/TeamCity/buildAgent/work/dc055fa257f562be/DerivedData/MyProject/Build/Products/AdHoc-iphoneos/MyProject.app
  [14:09:13] :     [Step 3/6] ** BUILD SUCCEEDED **
  </code></pre>
  
  <p>Because it's running in a CI I looked for user interaction problems (opening the keychain...etc') but usually xcodebuild spews the relevant errors.</p>
  
  <p>Is there any other log I can dig into to find the cause of the build failures?</p>
  
  <p>EDIT:
  Seems I had the same problem like <a href="https://stackoverflow.com/questions/19506982/build-failed-jenkins-ios-no-error">build failed jenkins iOS no error</a>.</p>