How to generate android apk without Android Studio using IONIC
Ionic cloud will take care of configuration, compilation and packing. just one command gives you apk files. I hope you understand the concept of what I’m going to show you. lets dive into it.
I assume that you have already one working or sample ionic app project to do our work. First we need ionic account for us to build apps. if you don’t have one create your ionic account. For our purpose I’m going to install ionic basic tabs app and try to build it. To do that we need to install it using the following command
ionic start CoolApp tabs
After this cd to CoolApp and run below command
If everything is OK it will start browser and you can see our CoolApp in browser.To create apk file this much simple app is enough. Now press Ctrl+C to kill the ionic app. Run the below command to login with your ionic username and password.
It will ask for Email and password after entering correct details it will give you Logged in! message. Now you are ready to create apk and publish your app. To do that we need to run one command
ionic package build android
Oh yes!, you got an error right? yes you will see this error message
Error: Missing Ionic App ID. Make sure to run “ionic upload” first or set your app_id in the ionic.config.json file.
This is because we have to create app in ionic dashboard. Go to https://apps.ionic.io/apps/ . In Dashboard click on New App button. There you have to provide app name. After creating it will navigate to app dashboard page there left corner app name with app id ex: ID: 0ab41f9a
Copy that Id and paste it into your ionic.config.json file. File content looks like
"app_id": " 0ab41f9a",
Now run that command again. After completion of that command you can go to your ionic app dashboard and select package tab. there you can see your app apk file. That’s It. Your are ready to install it on any android device and test it.