Created
September 17, 2016 12:24
-
-
Save shoarai/ccc4b029615ee125e35ca5c2b148437a to your computer and use it in GitHub Desktop.
Make APK of Ionic application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MY_DIRNAME=$(dirname $0) | |
cd $MY_DIRNAME | |
# Check arguments | |
if [ $# -ne 1 ]; then | |
echo "Input an alias name as argument." | |
exit 1 | |
fi | |
# Set variables | |
ALIAS=$1 | |
KEY_FILE=../$ALIAS.keystore | |
UNSIGNED_FILE=./platforms/android/build/outputs/apk/android-release-unsigned.apk | |
SIGNED_FILE=../app.apk | |
# Build, Sign and Optimize | |
cordova build --release | |
jarsigner -verbose -tsa http://timestamp.digicert.com -keystore $KEY_FILE $UNSIGNED_FILE $ALIAS | |
/Applications/android-sdk-macosx/build-tools/21.1.1/zipalign -v 4 $UNSIGNED_FILE $SIGNED_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment