title: Can't generate release build for Cordova iOS App
body: <blockquote>
    <p>I am using <strong>Phonegap CLI 3.1</strong> and <strong>XCode5</strong>. I want to generate the release build for iPhone Application through command line, I have valid <strong>distribution certificate</strong> and <strong>mobile provisioning profile</strong>. I want to generate the release build totally through command and don't want to use XCode GUI or Phonegap Build. I have tried too much with xcodebuild, xcrun and even corodva build command but none of them provide me the release build file (either in .app format or .ipa).</p>
  </blockquote>
  
  <p><strong>Method 1 (Use xcodebuild)</strong>  </p>
  
  <pre><code>a) xcodebuild -project MyApp.xcodeproj -alltargets -sdk iphoneos7.0 PROVISIONING_PROFILE="PROFILE_UUID.mobileprovision" -configuration Release
  </code></pre>
  
  <p>** BUILD FAILED **<br>
  The following build commands failed:  </p>
  
  <p>CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler  </p>
  
  <p>CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7/MainViewController.o MyApp/Classes/MainViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler  </p>
  
  <p>CompileC build/MyApp.build/Release-iphoneos/MyApp.build/Objects-normal/armv7s/AppDelegate.o MyApp/Classes/AppDelegate.m normal armv7s objective-c com.apple.compilers.llvm.clang.1_0.compiler<br>
  <strong>(3 failures)</strong><br>
  <hr> 
   <strong>Method 2 (Use corodova build and xcrun to sign the app)</strong></p>
  
  <pre><code>a) cordova build ios -release
  </code></pre>
  
  <p>Compiling app on platform "ios" via command "/Users/Macuser/Desktop/MyApp/platforms/ios/cordova/build" --release Platform "ios" compiled successfully.  </p>
  
  <pre><code>b) xcrun -sdk iphoneos PackageApplication -v "build/Release-iphoneos/MyApp.app" -o "build/Release-iphoneos/MyApp.ipa" --sign "iPhone Distribution: NAME (ID)" --embed "PROFILE_UUID.mobileprovision"
  </code></pre>
  
  <p><code>error: Failed to read entitlements from '/tmp/iyibGn3aUv/Payload/MyApp.app</code></p>