To use distribute cordova
command you'll need to create a distribute.json
first, like examples/configs/cordova-distribute.json
.
The following paragraphs describes all sections of a tipical distribute.json
for a Cordova app; by the way, you also have to add the commons configurations, and check for the specific iOS and Android configurations.
All *
marked fields are mandatory.
If you want to dynamically change version in an HTML file, use the <mad-app-version>
tag and specify the HTML file path in htmlVersionPath
attribute. Of course you also have to add the v
task in distribute cordova
command.
"source": {
// Path of HTML file that contains `<mad-app-version>` tag
"htmlVersionPath": "src/app/login/login.html"
}
All details about Cordova build process.
"cordova": {
// Path in where to launch all cordova commands
"path": "app",
// Custom command to build Android platform
// default "cordova build android --release"
"buildAndroidCommand": "npm run build:android:prod",
// Custom command to build iOS platform
// default "cordova build ios"
"buildIosCommand": "npm run build:ios:prod"
}
Specific configurations for build iOS and Android platforms.
"ios": {
// iOS app's bundleId to write into id attribute inside config.xml file,
// before build the iOS platform
"bundleId": "it.lcaprini.test",
},
"android": {
// Android app's package name to write into id attribute inside config.xml file,
// before build the Android platform
"bundleId": "it.lcaprini.test",
}
This utility launches all tasks for compiling, building and uploading a Cordova mobile app.
$ distribute cordova <app-version> -t <[c,v,i,a,u,e]> [options]
To correcly run process you'll need to specify the app version in semver format and one or more task from this list:
v
: Changes app version editing thesources.htmlVersionPath
before run Cordova build processc
: Compiles HTML, Javascript, CSS files intowww
folder using the command (script or task runner) specified indistribute.json
i
: Builds, archives, exports a certified.ipa
file with its.plist
and moves all files intobuildsDir
foldera
: Builds, archives, exports a certified.apk
file and moves it intobuildsDir
folderu
: Uploads the created app on the remote (S)FTP serverz
: Zip and upload Cordovawww
folder on the remote (S)FTP servere
: Sends an email with links and QRCode for download when the process ends
- option:
-p, --config <config-path>
descr: Path ofdistribute.json
to use for process default:./distribute.json
- option:
-a, --android-version-code <version-code>
descr: Version Code for Android build default:MAJOR * 10000 + MINOR * 100 + PATCH
- option:
-i, --ios-bundle-version <bundle-version>
descr: CF Bundle Version for build default:MAJOR * 100 + MINOR * 10 + PATCH
- option:
-c, --change-log <changelog.txt | "Text with *** line separator"
descr: Path of a.txt
file that contains all changelog (one per line), or a string with***
line separator default:No changelog
- option:
-q, --qr-code
descr: Print a QRCode coded with repository homepage in the terminal window when process is complete default:false
- option:
-u, --unsigned
descr: Skipsjarsigner
andzipalign
tasks during the Android build process [Android only] default:false
- option:
-v, --verbose
descr: Print all messages in terminal insted only the task details default:false
- option:
-f, --force
descr: The process starts and doesn't ask anything during all tasks default:false
- option:
-h, --hidden
descr: Hide this build from repository homepage; use it for pre release and alpha/beta versions default:false