title: Re-sign IPA (iPhone)
body: <p>I currently build all my applications with hudson using xcodebuild followed by a xcrun without any problems</p>
  
  <p>I've received a couple of IPA files from different people that I would like to re-sign with a enterprise account instead of the corporate account (for the app store, or sometimes ad-hoc distributed).</p>
  
  <p>My problem is that when I try to resign the app, it won't install on my device (and it should since it's a Enterprise build). The error message is on the device (not in iTunes) and it tells me simply that it couldn't install the app. No more information is given.</p>
  
  <p>I've found some information, ( <a href="http://www.ketzler.de/2011/01/resign-an-iphone-app-insert-new-bundle-id-and-send-to-xcode-organizer-for-upload/" rel="noreferrer">http://www.ketzler.de/2011/01/resign-an-iphone-app-insert-new-bundle-id-and-send-to-xcode-organizer-for-upload/</a> )</p>
  
  <p>And this might be possible. The problem I'm facing is that it doesn't seem to embed the mobile provisioning profile as I do with my normal builds (using xcrun) is this possible to control with the codesign tool, or is it possible to re-sign with xcrun?</p>
  
  <p>With my resign script i currently do</p>
  
  <ul>
  <li>unzip app.ipa</li>
  <li>appname=$(ls Payload)</li>
  <li>xcrun -sdk iphoneos PackageApplication -s "$provisioning_profile" "$project_dir/Payload/$appname" -o "$project_dir/app-resigned.ipa" --sign "$provisioning_profile" --embed "$mobileprovision"</li>
  </ul>
  
  <p>I've looked in the resulting ipa file and it seems to be very similar to the original app. What files should really change here? I initially thought the the _CodeSignature/CodeResources would change, but the content looks pretty much exactly the same.</p>
  
  <p>Pointers are much appreciated.</p>