Code Signing For Android
Learn how to code sign Ionic Android apps.
Code signing an Android application
iOS requires signing certificates and provisioning profiles for development and distribution. Android simply requires an app to be signed only when it’s ready to be published to the Google Play Store.
Prior to releasing for Google Play, we can publish a debug (non-signed) version of the app to your Android device(s) for testing. Compared to the different iOS configuration and set-up requirements, this does make life a lot easier as a developer.
Signing Android applications is quite simple, though, and involves working with either of the following tools:
- Keystore command-line utility
- Android Studio
We’ll explore each of the above tools, starting with the command-line-based Keystore utility, a free software tool included with the system JDK, which is used to manage cryptographic keys and trusted certificates.
Code signing an Ionic Cordova app
In the terminal, navigate to the root of app directory and issue the following command (replacing app-name
with the name of app and alias_name
with a suitable alias for the Keystore file):
keytool -genkey -v -keystore app-name-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
When the above command is run, we will be prompted to create a password for the Keystore and then answer a series of questions before the file is finally created.
When this process has been completed, the generated Keystore file will be saved in the root directory of our app.
Remember: For future reference, it would be wise to save the Keystore file to another location outside of the project. Do not lose this Keystore file because you won’t be able to make updates to the Android app if you do.
We definitely do not want this file to be added or made available to version control, as this would present a huge security risk. It also shouldn’t be in the ...