title: How to resign an app with app store provisioning profile to add beta-reports-active key?
body: <p>In order to distribute apps via Apple's new Test Flight service the <code>beta-reports-active</code> key needs to be present. Currently I'm using Apple's bot server to distribute to the old Test Flight system with and Ad Hoc distribution profile. Using a post build trigger I want to take the <code>archive</code> that is created and build an App Store Distribution <code>ipa</code> that I can upload to iTunes Connect. I've written a script that does this. I use the <code>xcrun</code> command to build:</p>
  
  <p><code>/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${APP_STORE_IPA}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}"</code></p>
  
  <p>The <code>SIGNING_IDENTITY</code> and <code>PROVISIONING_PROFILE</code> are both app store distribution certificates/profiles. So the provisioning profile is getting embedded in the <code>ipa</code> and it contains the <code>beta-reports-active</code> flag. However, when I look at the <code>ipa</code> to verify its entitlements it is not present. </p>
  
  <p>What am I doing wrong? All information I've seen on this has just suggested regenerating the provisioning profile. I've done this and know the key is present. It is not getting added to the entitlements. I have a widget that gets bundled in the ipa as well. I am not resigning that.</p>