Resign IPA from development to enterprise

It is possible to resign the ipa after it is built.

  1. Terminal way - You can try this. https://coderwall.com/p/cea3fw/resign-ipa-with-new-distribution-certificate

  2. Tool - https://github.com/xndrs/XReSign - A wonderful tool to resign the IPA.


To resign ipa for enterprise or ad-hoc distribution you can follow below simple steps:

To resign app using terminal you can follow below steps:

  1. Unzip ipa

    unzip MyApp.ipa

  2. Remove existing signature

    rm -rf Payload/MyApp.app/_CodeSignature/

  3. Copy your Ad-Hoc or enterprise provisioning profile to payload's embedded provisioning profile.

    cp ~/Desktop/MyAdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision

  4. Re-sign .app file with related code signing identity for Ad-hoc or Enterprise certificate available in Keychain.

    codesign -f -s "iPhone Distribution: Code signing Certificate for Enterprise or Ad-hoc app" Payload/MyApp.app

  5. Zip payload and give name of ipa you want.

    zip -qr MyApp_Resigned.ipa Payload/


You can use fastlane and resign command

Installation in Doc.

usage:

1) fastlane init

2) fastlane/Fastlane(file)

default_platform(:ios)

platform :ios do
  desc "Resigning Current Provision"
  lane :resigner do
    resign(
      ipa: "location/appName.ipa",    
      signing_identity: "iPhone Distribution: Bbalbalbalbal.xxxxx",
      provisioning_profile: "location/xxxxx.mobileprovision",
    )
    # add actions here: https://docs.fastlane.tools/actions
  end
end

3) run fastlane ios resigner