Set app name in environment

Hi all,

i have a stage and a prod environment in my project, is it possible to set there the app name and also the app id?

i was looking throug the docs but couldnt find anything :frowning:

also a manipulation of the app icon would be interesting :slight_smile:

best regards
harald

edit: i tried to put it in the command line while building… ionic cordova build android --release --variable APP_NAME=“STAGE”
but it seems this is not used

Did you find this?

uh thanks, but thats confusing for me… setting a variable in the angular framework is able to overwrite the bundle name for the ionic android app name?

I thought by “app name” you just meant having some environment-dependent variable available for display to the user inside the app.

oh no sorry for missundertanding… i mean the app name that is visible under the app icon

it would also be okay when i could provide the app name from the command line :slight_smile:

so that the users can see if this is the STAGING app or the PRODUCTIVE App

In that case I’m not aware of any official hook for doing that, but I would suggest looking into customizing the scripts stanza of package.json to call some sort of script to do what you are looking for at the beginning of npm run build - that’s what I’ve done to bake things like git commit hashes into app code.

yes that was something i would try to do… but to do so i would need a possibility to provide the app name over the command line… i found some older posts for older versions of ionic where they did it by adding --variable APP_NAME=“Demo APP” to the build command… but i think this is not working any more.

is there maybe a newer command to do that?

rapropos, it helped, thanks.