How to build for release

I have multiple people building in different ways, and I don’t know which is the correct, best one for phones.

Which is better: (or is there no difference)
ionic build ____ --prod --release
ionic build ____ --release

Also, one dev says that he just does ionic run ios --device, then Xcode archive and uploads. That seems wrong to me. Does he needs to use the correct build one from above, or is that ok?

For iOS I do:

ionic build ios --prod

For android I do:

ionic build android --prod --release

–prod = Tell Ionic build script to use algorythms to compress code, etc. and process full buiild

–release = Tell cordova to sign the app (apks) with a certificate which is needed to publish in the Play store

I personaly don’t use --device. Once I have built the iOS app, I open XCode, check everything is fine and then process to archive and upload with XCode.

2 Likes

Thanks.
I have a very old reference saying:
ionic build ios --release

And you use ionic build ios --prod.
Why don’t you do ionic build ios --prod --release?

Good point, till today I didn’t but I maybe should actually. Have to build a release this week, I gonna try and gonna post the results.

Note: As described in the documentation, I remove the cordova-plugin-console plugin too (ionic plugin rm cordova-plugin-console --save)

1 Like

hey @AmitMY

so I’m currently building my release for iOS

like I already said, –prod is a must. it tells Ionic scripts to performs everything possible to produce a better, smaller and faster application

I tried to use the command –release for iOS too but unfortunately that doesn’t work for me. When I add that cordova option, I land on an error. My quick guess is, in case of iOS and my project, is that I land on an error because I let Xcode manage my signing/certificates automatically, but like I said maybe it’s only me.

Therefore I still gonna publish my app like I describe here above.

1 Like

Thanks for the update
I wonder what that old reference is about than… I will tell my guys to use --prod at least, and refer them here.

1 Like

Sure cool. Tell them too that --release is a must for releasing in the android/play store