title: Resigning ipa with xcrun PackageApplication prevents IPA installation
body: <p>I'm building my application for AD Hoc distribution in a pretty standard way with xcodebuild. During the build provisioning profile (profileA) is embedded and application is signed with an certificate (certA) - CODE_SIGNING_REQUIRED is set to YES in SDKSettings.plist.
  After the build I would like to embed a different provisioning profile (profileB) and resign my application with a different certificate (certB). For this I'm using:</p>
  
  <pre><code>SIGNING_IDENTITY=certB
  PROVISIONING_PROFILE=full/path/to/profileB
  
  /usr/bin/xcrun  PackageApplication -v "${CONFIGURATION_BUILD_DIR}/${PROJECT_NAME}.app" -o "${CONFIGURATION_BUILD_DIR}/${IPAFILE}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}"
  </code></pre>
  
  <p>IPA package is successfully created, profile (profileB) is embedded and sign with a new certificate (certB) but unfortunatelly i cannot install the package on the device. The installation progress bar hangs on 4/5 during the installation and the error message pops up "Cannot download the program. You cannot install the 'XXX' right now." with Close and Retry buttons. (it is my translation so it might not be 100% accurate). Of course, the device UDID is included into the profile. If I don't resign the package the application might be installed on the device(with profielA and certA), also if i set use certB and profileB in XCODE settings the package also might be installed. Do you know what might be the problem? It looks as if there is somethings that prevents my package from the installation on the device but I don't have any idea what else I should change. </p>
  
  <p>Regards!</p>