Ranieri Mazili
Ranieri Mazili

Reputation: 833

How to replace endpoints on IPA file on azure build/release pipeline?

I have a build and release pipeline working pretty well for iOS app (react native), the problem is that as IPA is a "binary" file, I have to replace endpoints for each environment on my build pipeline, which I think is not right, because this way I have to implement 3 build (one for each enviroment "dev, staging, production).

Is there a way to build the IPA and on release pipeline unpack the IPA, replace the endpoints and the repack it?

I could see that IPA is just like a zip file and my endpoints is inside a main.jsbundle. Can I just unzip, replace and zip it back? What about provisioning profiles? signing?

I really appreciate any help

Upvotes: 0

Views: 668

Answers (1)

I recommend using fastlane.

https://fastlane.tools/

With fastlane you can resign your ipas from development to release, you can change the bundleId, the provisioning profiles, certificates and such with just a few lines of code:

resign(
    ipa: "../location/of/your.ipa",
    signing_identity:"name of the certificate",
    provisioning_profile: {
          "the.old.bundleId" => "location/of/new/provisioning-profile.mobileprovision"
        },
    bundle_id: "the.new.bundle.id"
)

As for your endpoints, you might want to provide them from inside the Info.plist for example, then just switch between your different Info.plists with fastlane: https://docs.fastlane.tools/actions/update_info_plist/

I also recommend you look into using the fastlane gym and pilot commands. Gym is a simple way of creating an ipa, and with pilot you can directly upload builds to Testflight:

http://docs.fastlane.tools/actions/gym/#gym http://docs.fastlane.tools/actions/pilot/#pilot

Upvotes: 1

Related Questions