Ionic 4: todo App + firebase
Lección 36 de 38 · 36 Building the App for Release Building Mobile Apps with Ion · Personas y blogs
36 Building the App for Release Building Mobile Apps with Ion
in this lesson we are going to build the application for Android to be released on the Google's Play Store we'll start by using the ionic CLI to
build the application for release and then once the final build is created we'll verify that the APK file that we'll upload to the Google Play Store has been created successfully so here we
are back inside Visual Studio code and we'll use the ionic CLI to build this application in release configuration for Android by default when you build your Android application using the ionic CLI
the application is built using debug configuration which means that any user can use the debugging tools and understand what is going on inside the application all the console logs and
debug information is available to the user if the application is built in debug mode so we need to make sure that we build the application in release configuration and to do that all we have
to do is execute a simple command and the command is ionic Cordova build followed by the name of the platform which is Android and then we have to pass in the flag – – release this
command is enough to build an Android package file that the Google Play Store requires and the Android package file will be created in the release configuration furthermore you can also
specify a flag called – – prod which stands for production and this flag only ensures that the apk file that is generated is optimized so the size of the apk file will be slightly less than
the file that you will otherwise generate so let's go ahead and execute this command ionic cordova build Android – – release – – prod to create the final build of our application for Android
keep in mind that only the release flag here is required while the production flag is not required at all it is up to you if you want to pass the prod flag or not if you face any problems during the
execution of this come and make sure that the path variables Android home and Java home are set if they are not set you're likely to get some errors
and there you can see that the build is successful and it took a total of 33 seconds for me along with that we also get a path where the actual apk file which is the release apk located so if
you go to file explorer or finder on Mac go inside the project folder go to the platforms folder the Android folder here you need to go inside the app folder then the build folder and here you have
a folder called outputs inside the output folder you have a folder called apk where you will have a folder called release in here we have the file app – release – unsigned not apk the unsigned
word in the name means that this APK however is the release apk but it is unsigned as of now so we need to sign this apk to ensure its integrity when we submit this apk to the Google Play Store
without signing the apk file the Google Play Store will not accept it so in the next lesson we'll learn how we can sign the apk to make it publish ready for the Google Play Store