I was wondering what is the recommended way to build ionic2 apps to send to the app stores.
My flow now is:
iOS: ionic build ios to build the project and then opening it in xcode, archiving, and uploading to Apple
Android: ionic build android to build the project, then cordova build --release android to build a release version, then use jarsigner to sign the android-release-unsigned.apk, use zipalign to align the apk and finally upload it to Google Play.
Is there a better way?
I have been using app-scripts v0.0.46 but noticed that the newest version builds development versions by default. How do I build production versions after I update?
You are done. This will enable production mode in angular2 with tree-shaking, AoT, etc and build your app in the folder www ready for you to serve in production.
–
Valid as of ionic2-rc5.
Get more detailed info on the available ionic scripts and what they do over here.
I think with app-scripts 0.0.47 you just need to pass the --prod flag to enable AoT/uglify, so e.g. ionic build android --prod. Everything else is the same.
You want both --prod and --release. --prod is for ionic-app-scripts, affecting the generated JavaScript code; --release is for Cordova, affecting the Android app itself. You also need to sign the Android apk before publishing it.
Use ionic build android --prod --release --keystore="your.keystore" --storePassword=your_password --password=your_password --alias="your_alias". Though, I’m not seeing a difference in load time, both at 16 seconds. =(
When i install app it takes 5 to 6sec to open.But when in reopen is also takes 5sec,is this the behaviour of android or my app is lacking something to load again.i my console it shows device ready not fired after 5sec msg also.
No it seems like your app is crashing. The app should be running in the background. You can double tap on the Home key (the key most far from your “Back” key). You should see your app in the background, still opened. If not, it crashed or you’re closing the app somehow.
If your device is RAM restricted, the OS may be terminating the app when switching to home-screen. If your device is storage-space restricted then similar problems can occur.
Either way, your replies are somewhat getting out of topic and there’s not much more we could advise that isn’t said many times already.
Works the opposite for me. ionic build android --prod produces a bigger file and I was not able to sign the generated android-dbug.apk using jarsigner.