title: Build Project From Terminal throws Provisioning Profile error
body: <p>I am trying to create <code>ipa</code> of my <code>application</code> using <code>terminal</code>.</p>
  
  <p>I am able to successfully <code>build</code> my application, but when converting into an <code>ipa</code>, it throws the following error:</p>
  
  <pre><code>Check dependencies
  Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “/Users/xxxx/Downloads/Certificate/xxxx.mobileprovision”, however, no such provisioning profile was found.
  CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'
  
  ** ARCHIVE FAILED **
  </code></pre>
  
  <p>When I try to build the same application using <code>X-Code</code>, it works fine with the same <code>provisioning profile</code>.</p>
  
  <p>The script I am running to build the <code>ipa</code> is </p>
  
  <pre><code>xcodebuild -verbose -project Build_Project_From_Terminal.xcodeproj -scheme nameOfProject -configuration Release -sdk iphoneos clean archive CONFIGURATION_BUILD_DIR="/Users/xxxx/Desktop/xxxx/Project Name/build" PROVISIONING_PROFILE="/Users/xxxxx/Downloads/Certificate/xxxxx.mobileprovision"
  </code></pre>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>I have changed my script to </p>
  
  <pre><code>DEVELOPER_NAME="xxxxxxxxx" APP_NAME="xxxxxx"
  
  xcodebuild archive -project $APP_NAME.xcodeproj -scheme $APP_NAME -archivePath ./$APP_NAME.xcarchive
  
  xcodebuild -exportArchive -exportFormat APP -archivePath ./$APP_NAME.xcarchive -exportPath ./$APP_NAME.ipa
  
  iphoneos PackageApplication -v ./$APP_NAME.app -o ./$APP_NAME.ipa --sign $DEVELOPER_NAME --embed ./*.mobileprovision
  </code></pre>
  
  <p>With this I am getting <code>$APP_NAME.ipa.app</code> as output. When I try to install this, it does not install at all.</p>
  
  <p>Any help will be appreciated.</p>