Deploy a hybrid app on the Google Play Store
These steps will work for Cordova, PhoneGap or Ionic. The only difference would be that wherever the cordova
call is cordova
, replace it with phonegap
or ionic
for your specific scenario.
Once you are finished and ready to deploy, follow these steps:
Open a command prompt window (terminal on macOS and Linux or command prompt on Windows).
Go to / path / to / your / project /, which we will call the root of the project.
At the root of the project, remove the Console plugin from your set of plugins.
Command: cordova plugin rm cordova-plugin-console
While still at the root of the project, use the cordova build command to create an APK to distribute the release.
Team: cordova build --release android
The above process creates a file called android-release-unsigned.apk
in the folder ProjectRoot/platforms/android/build/outputs/apk/
Sign and align the APK using the instructions https://developer.android.com/studio/publish/app-signing.html#signing-manually
At the end of this, the APK step you receive can be downloaded to the Play Store.
Note: As a newbie or newbie, the last step can be a bit confusing, as for me. You may encounter several problems and ask some questions regarding what these commands are and where to find them.
Q1. What are jarsigner and keytool?
Ans: Android subscription instructions tell you specifically what jarsigner and keytool are , but that doesn’t tell you where to look for them if you run the “command not found error” command line window.
Thus, if you added the Java Development Kit (JDK) to the PATH variable, simply execute the commands, as in the Guide. BUT, if you do not have it in your PATH, you can always access them from the bin folder of your JDK installation.
Q2. Where is the zipalign?
Ans: There is a high probability of not finding the zipalign command and getting the "not found error" command. You are likely to be googling zipalign and where to find it?
The zipalign utility is present in the Android SDK installation folder. On macOS, the default location is at, user-name/Library/Android/sdk/
. If you navigate to the folder, you will find a bunch of other folders like docs
, platform-tools
, build-tools
, tools
, add-ons
...
Open the build-tools
folder. cd build-tools
. There will be several folders that will be versioned according to the chain of build tools that you use in the Android SDK Manager. ZipAlign is available in each of these folders. I personally go to the folder with the latest version. Open any.
On macOS or Linux, you may have to use ./zipalign
instead of just typing in zipalign
, as mentioned in the documentation. On Windows, zipalign
pretty good.
source share