Any ideas about building multiple apps (for diff envs) after ejecting?

I recently ejected from expo and I am struggling to find a straightforward way of building an app for staging and production with the same XCode project. While in the managed workflow this was fairly easy. I could swap out the app.json which would build for whatever the new config was.

Now that I am ejected, I don’t see a way to build an app for production and one for staging with the single XCode project. The XCode project essentially represents whatever env I had in my app.json at the time of ejecting.

The ideas that I have had are:

  1. Write a script that can swap out all config variables that need to change across the XCode settings (including swapping icons, splash, etc…)
  • Downsides are that adding more native code could potentially need updates to this script and it would be easy to break and not notice or even not realize it needs to be updated
  1. Eject twice with the app.json with both configs and put them in separate folders
  • Downsides would be managing two full XCode projects and having to update them both any time I want to add native code which seems brittle.
  1. Keep a branch that has the staging app ejected and keep it up to date
  • Downsides would be similar to option 2 but without the need for two folders but potentially worse because I don’t want to manage another branch.
  1. Swap app.json config and re-eject when I want to build staging
  • Downside is a few manual updates any time I want to build staging before I can actually build

Has anyone run into this or have thoughts about it? I didn’t see any other similar issues to this when I looked around the forums and the docs. Thanks!

Hey, I’m currently having the same issue. Have you found a proper way to handle this by any chance?
I’d be grateful if you could share your solution.

Thanks!