title: xcodebuild fails to build from terminal but succeeded from xcode
body: <p>I'm trying to build a framework using xcode 6-beta 3
  when compiling it using xcode it works but when compiling it  from a terminal with the command:</p>
  
  <pre><code>xcodebuild -project &lt;projName&gt; -scheme &lt;schemeName&gt;  -configuration Debug clean build 
  </code></pre>
  
  <p>I'm getting the following error</p>
  
  <pre><code>CodeSign error: entitlements are required for product type 'Framework' in SDK 'Simulator - iOS 8.0'. Your Xcode installation may be damaged.
  </code></pre>
  
  <p>and the build fails to complete.
  at the end of the log it says </p>
  
  <pre><code>The following build commands failed:
  PhaseScriptExecution Run\ Script build/myProj.build/Debug-iphoneos/myScheme.build/Script-DB9DC5BB19740464002F9181.sh
  </code></pre>
  
  <p><br/>
  <strong>upgrade:</strong></p>
  
  <p><br/>
  the script that failed is :</p>
  
  <pre><code>   #!/bin/sh 
  # Config 
  UFW_TARGET=AppCore
  
  # Default build dir
  UFW_BUILD_DIR="./build"
  
  # Global vars
  if [ -z ${SDK_NAME} ]; then
  
  # Use the latest iphoneos SDK available
  UFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o "iphoneos.*$")
  while read -r line; do
  UFW_SDK_VERSION="${line}"
  done &lt;&lt;&lt; "${UFW_GREP_RESULT}"
  else
  
  # Use the SDK specified by XCode
  UFW_SDK_VERSION="${SDK_NAME}"
  fi
  
  UFW_SDK_VERSION=$(echo "${UFW_SDK_VERSION}" | grep -o "[0-9].*$")
  
  UFW_IPHONE_DIR="${UFW_BUILD_DIR}/${CONFIGURATION}-iphoneos"
  UFW_SIMULATOR_DIR="${UFW_BUILD_DIR}/${CONFIGURATION}-iphonesimulator"
  UFW_UNIVERSAL_DIR="${UFW_BUILD_DIR}/${CONFIGURATION}-universal"
  
  # Static lib name
  STATIC_LIB_NAME="appCore"
  UFW_FRAMEWORK_DIR="${STATIC_LIB_NAME}.framework"
  
  # Build Framework
  
  rm -rf ${UFW_UNIVERSAL_DIR}
  
  xcodebuild ARCHS="armv7 armv7s arm64" -target "${UFW_TARGET}" -configuration ${CONFIGURATION} -sdk iphoneos${UFW_SDK_VERSION} clean build RUN_CLANG_STATIC_ANALYZER=NO
  
  if [ "$?" != "0" ]; then echo &gt;&amp;2 "Error: xcodebuild failed"; exit 1; fi
  
  xcodebuild ARCHS="i386 x86_64" -target "${UFW_TARGET}" -configuration ${CONFIGURATION} -sdk iphonesimulator${UFW_SDK_VERSION} clean build RUN_CLANG_STATIC_ANALYZER=NO
  
  if [ "$?" != "0" ]; then echo &gt;&amp;2 "Error: xcodebuild failed"; exit 1; fi
  
  mkdir -p "${UFW_UNIVERSAL_DIR}"
  mkdir -p "${UFW_UNIVERSAL_DIR}/${UFW_FRAMEWORK_DIR}"
  mkdir -p "${UFW_UNIVERSAL_DIR}/${UFW_FRAMEWORK_DIR}/Headers"
  
  cp -a "${UFW_IPHONE_DIR}/${UFW_FRAMEWORK_DIR}/Headers" "${UFW_UNIVERSAL_DIR}/${UFW_FRAMEWORK_DIR}"
  
  echo "running lipo -create -ouput..."
  lipo -create -output "${UFW_UNIVERSAL_DIR}/${UFW_FRAMEWORK_DIR}/${STATIC_LIB_NAME}" "${UFW_IPHONE_DIR}/${UFW_FRAMEWORK_DIR}/${STATIC_LIB_NAME}" "${UFW_SIMULATOR_DIR}/${UFW_FRAMEWORK_DIR}/${STATIC_LIB_NAME}"
  if [ "$?" != "0" ]; then echo &gt;&amp;2 "Error: lipo failed for ${STATIC_LIB_NAME}"; exit 1; fi
  </code></pre>
  
  <p><br/>
  Does anyone know what I'm doing wrong ? <br/>
   any help be much appreciated</p>