Resign ios app

  1. CD to the dir which contains your ipa file.

    cd ~/Downloads/my_app
  2. Unzip the app

    unzip my_app.ipa
  3. Delete the Mobile Provision in the app.

    rm Payload/
  4. Copy your new provisioning profile into the app.

    cp ~/Downloads/ProvisionAdHoc.mobileprovision Payload/
  5. Export required system vars

    export EMBEDDED_PROFILE_NAME=embedded.mobileprovision
    export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
  6. Resign your code

    codesign -f -vv -s "iPhone Distribution: Joe Smith" Payload/
  7. Recreate your ipa file.

    zip -r Payload Payload
    mv my_app.ipa