Running Production Build On iOS Does Not Use Prod Environment

Hello,

I am trying to build my Ionic Angular app using production flag. By running:

$ ionic cap build ios --prod

Then I run it from XCode and changed the scheme build configuration into Release, but the result is that my app is still using all variables from environment.ts not environment.prod.ts.

How to instruct it to use environment.prod.ts?

In Android it works tho. Not sure how to fix this in iOS

I am havingthe same issue with Android and iOS.

If I find the solution I will let you know

I type ionic build --prod as command, and it works perfectly

then npx cap copy
and finally npx cap open ios

1 Like