Skip to content

Instantly share code, notes, and snippets.

@shoarai
Created September 17, 2016 12:24
Show Gist options
  • Save shoarai/ccc4b029615ee125e35ca5c2b148437a to your computer and use it in GitHub Desktop.
Save shoarai/ccc4b029615ee125e35ca5c2b148437a to your computer and use it in GitHub Desktop.
Make APK of Ionic application
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