Skip to content

Instantly share code, notes, and snippets.

@dricardo1
Forked from rknell/build-release.sh
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dricardo1/b0184b327607c6fe29e5 to your computer and use it in GitHub Desktop.
Save dricardo1/b0184b327607c6fe29e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/
#USAGE!
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url)
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!)
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!)
# 5. Check path/to/my/project/Release/android for your sparkling new apk!
#
# This worked and was uploadable to the google play store.
cordova build android --release
ant release -f platforms/android/build.xml
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore <AndroidKeyName>.keystore platforms/android/bin/<ProjectName>-release-unsigned.apk <AndroidKeyNameAlias>
mkdir -p Release/android
zipalign -f 4 platforms/android/bin/<ProjectName>-release-unsigned.apk Release/android/<ProjectName>-release.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment