We have the need to override values in fastlane's appfile in certain situations, e.g. to use a different apple account for publication of the app, but there is no documented official way.
The . env file contains the individual user environment variables that override the variables set in the /etc/environment file. You can customize your environment variables as desired by modifying your .
A . env file or dotenv file is a simple text configuration file for controlling your Applications environment constants. Between Local, Staging and Production environments, the majority of your Application will not change.
env file is placed at the base of the project directory. Project directory can be explicitly defined with the --file option or COMPOSE_FILE environment variable.
The easiest way to do that is using environment variables:
Use an Appfile
like this:
apple_id ENV["APPLE_ID"] || "[email protected]"
app_identifier ENV["APP_IDENTIFIER"] || "com.company.default"
When you now call fastlane without environment variables:
fastlane beta
it will use the default values provided ([email protected]
)
to set a different value you can use
APP_IDENTIFIER="com.custom.app" fastlane enterprise
Also as already pointed out by other replies, you can always have multiple lanes for different environments and just pass a different app identifier or username to each of the actions you're calling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With