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/my_app.app/embedded.mobileprovision
    
  4. Copy your new provisioning profile into the app.

    cp ~/Downloads/ProvisionAdHoc.mobileprovision Payload/my_app.app/embedded.mobileprovision
    
  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/my_app.app
    
  7. Recreate your ipa file.

    zip -r Payload Payload
    mv Payload.zip my_app.ipa