59 | | |
60 | | 8. Build for Release |
61 | | - Modify the Manifest to be able to use the app on older devices (v4.4): {{{platforms/android/AndroidManifest.xml}}} |
62 | | {{{ |
63 | | <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" /> |
64 | | }}} |
65 | | - Configure the default server, if-required: {{{www/config/settings.js}}} |
66 | | {{{ |
67 | | 'url': { |
68 | | type: 'url', |
69 | | defaultValue: 'http://my.server.org/eden', |
70 | | writable: false, |
71 | | }}} |
72 | | - @ToDo: Branding |
73 | | - create the non-debug APK |
74 | | {{{ |
75 | | cd eden_mobile |
76 | | cordova build --release android |
77 | | }}} |
78 | | - File available as: {{{platforms/android/build/outputs/apk/android-release-unsigned.apk}}} |
79 | | - Sign the app: |
80 | | * https://developer.android.com/studio/publish/app-signing.html |
81 | | * https://cordova.apache.org/docs/en/latest/guide/platforms/android/ |
82 | | {{{ |
83 | | # Generate Private Key (just once, outside the eden_mobile folder) |
84 | | # keytool comes with your JRE, so may need to ensure it's bin directory is in your PATH |
85 | | keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias |
86 | | # Optimise (zipalign comes with Android SDK build-tools, so may need to ensure it's in your PATH, e.g. %USERPROFILE%\AppData\local\android\sdk\build-tools\25.0.2) |
87 | | zipalign -v -p 4 android-release-unsigned.apk android-release-unsigned-aligned.apk |
88 | | # Sign (apksigner comes with Android SDK build-tools too) |
89 | | apksigner sign --ks my-release-key.jks --out android-release.apk android-release-unsigned-aligned.apk |
90 | | }}} |