Ionic 4 environments

I’ve followed the following tutorial:

It’s working fine, but building with cordova, doesn’t make use of the Angular environments.
(So, ionic cordova run android --prod) uses the stock url instead of the prod url.

Is it on the roadmap for Ionic 4? Using Angular prod environment instead of something hidden in Ionic? And if so, can we add more Angular environments (So we can work with dev, test, acceptance & production environments) to work with the ionic cordova build environment??


I’ve the same problem, I need to create ios and android specific environment.ts files but when I run the command

ionic cordova build ios --env=devios

The environment.devios.ts file is ignored

Have you found any solution for this? I have the same problem …

Best way to do is (Ionic 4)

  1. Create an environment file

  2. modify angular.json file
    add configuration live under architect

    do the same under serve

  3. run command
    ionic cordova build android --configuration live

-------------Hope it will help--------------


For making build using ionic cordova build , configuration also hsve to be added to “ionic-cordova-serve” in angular.json
then after you could make build or run your app with
ionic cordova build android --configuration live