skip to Main Content

I have a react native application built and distributed through microsoft appcenter. for the iOS side, I have a release variant which is the live production variant. and i have a staging variant. the git flow im trying to achieve is something like this:

  1. create feature branch from either master or staging (for the sake of
    this argument) –>
  2. push OTA update to staging variant –>
  3. merge staging variant into master (this is the key part)

I want to be able to merge staging into master without having to manually set the defaultConfigurationName each time i pull staging into master, or push the master-branched-feature-branch to staging. I want a dynamic value: master’s value to always be ‘release’ and staging to always be ‘staging’.

Problem:
When merging staging branch into master branch (production), the defaultConfigurationName in project.pbxproj changes the variant that will be built by microsoft appcenter from the release variant (production) to the staging variant

enter image description here

lets say i have an env variable called "ENVIRONMENT", with values of ‘release’ and ‘staging’, corresponding to ‘master’ and ‘staging branches. i want to automate management of the ios build configuration when merging staging into master, and not have to manually reset defaultConfigurationName back to ‘release’ each time i merge staging into master. how can i set the env variable’s value to the value of "defaultConfigurationName" in project.pbxproj file?

Note: i dont need help setting up environments or environment variables. i also dont want to create an additional target.

2

Answers


  1. Please have a look at this blog post, it shows how to set up multiple environments for android and iOS.

    Login or Signup to reply.
  2. I came across this issue and found that you can update the info.plist file found in ios/app/app/info.plist to include your environment variables.

    Eg

    <key>CFBundleVersion</key>
    <string>$(CAPACITOR_BUILD_NUMBER)</string>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search