Skip to content

Instantly share code, notes, and snippets.

@arbakker
Last active June 9, 2021 23:57
Show Gist options
  • Save arbakker/f3eb386e006f238c4dec to your computer and use it in GitHub Desktop.
Save arbakker/f3eb386e006f238c4dec to your computer and use it in GitHub Desktop.

Instructions to build android app

Prerequisites

  1. Create a private key according to this: http://developer.android.com/tools/publishing/app-signing.html#secure-key keytool -genkey -v -keystore my-release-key.keystore -alias scb_app -keyalg RSA -keysize 2048 -validity 10000
  2. Create ant.properties file with the following lines: key.store=/anton/Workspace/android- keys/my-release-key.keystore key.alias=scb_app

Build and sign app

  1. cordova build android
  2. cd platforms/android
  3. ant release
  4. cd bin
  5. jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/anton/Workspace/usb-app/android-keystore/my-release-key.keystore CordovaApp-release-unsigned.apk scb_app
  6. jarsigner -verify -verbose -certs CordovaApp-release-unaligned.apk
  7. rm scb-app.apk
  8. zipalign -v 4 CordovaApp-release-unaligned.apk scb-app.apk
  9. scp scb-app.apk abakker@thor.geocat.net:/var/www/bongerd

Oneliner: cordova build android && cd platforms/android && ant release && cd bin && jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /Users/anton/Workspace/usb-app/android-keystore/my-release-key.keystore CordovaApp-release-unsigned.apk scb_app && jarsigner -verify -verbose -certs CordovaApp-release-unaligned.apk && rm scb-app.apk && zipalign -v 4 CordovaApp-release-unaligned.apk scb-app.apk && scp scb-app.apk abakker@thor.geocat.net:/var/www/bongerd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment