I’d like to have 3 versions of our app: development, staging, and production. I’m able to use EAS Build profiles to setup the build with different environment variables and release channels, which is great. But I’d also like to be able to install the different versions on the same device at the same time.
I have been researching this and am unsure what the best practice would be for a bare workflow. I found this discussion for the managed workflow:
I also found this git commit showing that you can’t set the bundle identifier in app.config.js anymore:
I’m imagining that the right way to do this is to set an environment variable for the build process itself and tell Xcode to reference that, but I’m unsure. Thoughts?
You need to create 3 separate xcode targets and 3 separate schemes (one scheme per target). In Xcode you can specify different bundle identifiers for each target and in eas.json build profile you can define which scheme should be built.
Next I was getting ** ARCHIVE FAILED ** in the FastLane build. The original “Dev” target worked. This lead me to see that pods were not being created, so I modified the podfile to have a section for each target (as far as I can see, nothing in Xcode would do this automatically). Now the iOS build process seems to be working.
Now I am working on doing the same with Android. I have setup 3 productFlavor’s with 3 different applicationId’s. This is working locally. To get EAS Build to do this, it sounds like I need to override the gradleCommand (as shown here: Adding multiple targets and product flavors - #10 by wodin).
Would that just be :app:assembleStageRelease, for example? I will give it a try…
I seem to have gotten past that error by manually adding all of the targets to the
pod install would probably do that after defining targets there,
if you are using dev client make sure to copy dev client config for all targets even if you don’t intend to use them as dev clients, toherwise dev client might be included in production builds
if you see output duplicated few times when you running pod install you can wrapp everyting in abstract target
abstract_target 'common' do
// all config should go here, targets bellow should be empty
target 'production' do
end
target 'staging' do
end
target 'dev' do
end
Would that just be :app:assembleStageRelease, for example? I will give it a try…
Yes, btw specify applicationId per flavor with applicationId key, using applicationIdSuffix won’t work with eas
Reopening this, as I am now working on using this setup with EAS Submit (just for submitting the production version). Starting with iOS, when I try to submit (with eas submit -p ios --profile production --latest) I get the error message:
Multiple schemes and targets found in Xcode project, bundle identifier couldn't be resolved.