From b8a302910b755f0abe4f64f23e6ec74786b3a36f Mon Sep 17 00:00:00 2001 From: Rishikesh Singh Date: Sun, 11 Oct 2026 15:09:48 +0530 Subject: [PATCH 1/2] docs: improve CLI pass-through argument documentation for Windows --- doc/readme.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/readme.md b/doc/readme.md index 0ccd72f6..d5606319 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -73,6 +73,8 @@ These options apply to all cordova-cli commands. Certain commands have options (`platformOpts`) that are specific to a particular platform. They can be provided to the cordova-cli with a '--' separator that stops the command parsing within the cordova-lib module and passes through rest of the options for platforms to parse. +> **Note for Windows users:** On Windows (Command Prompt and PowerShell), the `--` separator must be enclosed in quotation marks (`"--"`) so that the shell forwards the arguments to platform build scripts correctly. + ## CLI Usage Example The following example illustrates how to utilize Cordova CLI to perform various tasks such as: @@ -122,10 +124,18 @@ Additionally, it includes an example showcasing the usage of specific options pr 7. Build Project for Android in Release Mode with Signing Parameters + **Unix/macOS:** + ```bash cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey ``` + **Windows:** + + ```bash + cordova build android --release "--" --keystore="..\android.keystore" --storePassword=android --alias=mykey + ``` + ## `cordova create` command Creates the directory structure for the Cordova project in the specified path. @@ -413,7 +423,7 @@ cordova build [ [...]] | --device | Build it for a device | --emulator | Build it for an emulator. In particular, the platform architecture might be different for a device vs. emulator. | --buildConfig=`` | Default: build.json in cordova root directory.
Use the specified build configuration file. `build.json` file is used to specify paramaters to customize the app build process especially related to signing the package. -| `` | To provide platform specific options, you must include them after `--` separator. Review platform guide docs for more details. +| `` | To provide platform specific options, you must include them after `--` separator (on Windows shells, enclose in quotes: `"--"`). Review platform guide docs for more details. ### Examples @@ -431,10 +441,18 @@ cordova build android --release --buildConfig=..\myBuildConfig.json - Build for `android` platform in release mode and pass custom platform options to android build process: +**Unix/macOS:** + ```bash cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey ``` +**Windows:** + +```bash +cordova build android --release "--" --keystore="..\android.keystore" --storePassword=android --alias=mykey +``` + ## `cordova run` command Prepares, builds, and deploys app on specified platform devices/emulators. If a device is connected it will be used, unless an eligible emulator is already running. @@ -463,7 +481,7 @@ cordova run [ [...]] | --emulator | Deploy to an emulator | --target | Deploy to a specific target emulator/device. Use `--list` to display target options | --buildConfig=`` | Default: build.json in cordova root directory.
Use the specified build configuration file. `build.json` file is used to specify paramaters to customize the app build process especially related to signing the package. -| `` | To provide platform specific options, you must include them after `--` separator. Review platform guide docs for more details. +| `` | To provide platform specific options, you must include them after `--` separator (on Windows shells, enclose in quotes: `"--"`). Review platform guide docs for more details. ### Examples From d8f472060ddfe2ff541adb446a12fcc7f42b52fa Mon Sep 17 00:00:00 2001 From: Rishikesh Singh Date: Sun, 11 Oct 2026 15:48:38 +0530 Subject: [PATCH 2/2] docs: address review comments on Windows CLI pass-through options --- doc/readme.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/readme.md b/doc/readme.md index d5606319..7501c3a3 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -28,10 +28,18 @@ description: Learn how to use Cordova CLI commands and their options. ## CLI Syntax +**Unix/macOS:** + ```bash cordova [options] -- [platformOpts] ``` +**Windows:** + +```text +cordova [options] "--" [platformOpts] +``` + ## Global Command List These commands are available at all times. @@ -127,13 +135,13 @@ Additionally, it includes an example showcasing the usage of specific options pr **Unix/macOS:** ```bash - cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey + cordova build android --release -- --keystore="../android.keystore" --storePassword=android --alias=mykey ``` **Windows:** - ```bash - cordova build android --release "--" --keystore="..\android.keystore" --storePassword=android --alias=mykey + ```text + cordova build android --release "--" --keystore="../android.keystore" --storePassword=android --alias=mykey ``` ## `cordova create` command @@ -436,7 +444,7 @@ cordova build android ios --debug --device - Build for `android` platform in `release` mode and use the specified build configuration: ```bash -cordova build android --release --buildConfig=..\myBuildConfig.json +cordova build android --release --buildConfig="../myBuildConfig.json" ``` - Build for `android` platform in release mode and pass custom platform options to android build process: @@ -444,13 +452,13 @@ cordova build android --release --buildConfig=..\myBuildConfig.json **Unix/macOS:** ```bash -cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey +cordova build android --release -- --keystore="../android.keystore" --storePassword=android --alias=mykey ``` **Windows:** -```bash -cordova build android --release "--" --keystore="..\android.keystore" --storePassword=android --alias=mykey +```text +cordova build android --release "--" --keystore="../android.keystore" --storePassword=android --alias=mykey ``` ## `cordova run` command @@ -488,7 +496,7 @@ cordova run [ [...]] - Run a release build of current cordova project on `android` platform emulator named `Nexus_5_API_23_x86`. Use the spcified build configuration when running: ```bash -cordova run android --release --buildConfig=..\myBuildConfig.json --target=Nexus_5_API_23_x86 +cordova run android --release --buildConfig="../myBuildConfig.json" --target=Nexus_5_API_23_x86 ``` - Run a debug build of current cordova project on `android` platform using a device or emulator (if no device is connected). Skip doing the build: