Skip to content

docs: improve CLI pass-through argument documentation for Windows (#1336) - #1530

Open
rishi919-rgb wants to merge 1 commit into
apache:masterfrom
rishi919-rgb:fix-windows-cli-passthrough-args
Open

rishi919-rgb wants to merge 1 commit into
apache:masterfrom
rishi919-rgb:fix-windows-cli-passthrough-args

Conversation

@rishi919-rgb

@rishi919-rgb rishi919-rgb commented Sep 26, 2026 •

Copy link
Copy Markdown

Platforms affected

Documentation / CLI (All platforms, specifically Windows Command Prompt and PowerShell, Android, iOS)

Motivation and Context

Fixes #1336

On Windows using Command Prompt or PowerShell, passing platform-specific arguments using the intermediate -- separator requires enclosing the -- in quotation marks ("--"). Without quotes, PowerShell throws syntax/parse errors or treats -- as a parameter terminator, leading to argument forwarding failures (as reported in apache/cordova-android#1671).

Description

Following reviewer feedback:

  • Standard CLI examples across Android, iOS, and the CLI guide continue to use the standard unquoted -- separator (Unix/macOS).
  • Added explicit, dedicated notes for Windows users explaining that on Windows (Command Prompt and PowerShell), the -- separator must be enclosed in quotation marks ("--"), with accompanying examples.
  • Added a dedicated "Passing Platform-Specific Arguments" subsection in the Cordova CLI guide (guide/cli/index.md) with concrete examples for Android (Gradle parameters, signing / packageType) and links to platform guides.

Testing

  • Executed npm test (npm run lint), passing with 0 errors.
  • Verified Markdown syntax and links across modified documentation files.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@GitToTheHub

Copy link
Copy Markdown
Contributor

I would leave the documentation examples to use just -- and note, that these are Unix/macOS examples. A note can be added, that on Windows the -- has to be enclosed in quotation marks. Giving Unix/macOS users more verbosed samples than necessary is also not a good solution.

@rishi919-rgb
rishi919-rgb force-pushed the fix-windows-cli-passthrough-args branch from 2a20840 to 7ae7767 Compare September 26, 2026 11:17
@rishi919-rgb

Copy link
Copy Markdown
Author

Thanks for the feedback @GitToTheHub! That makes complete sense.

I have updated the changes accordingly:

  • Kept the standard CLI examples using the clean, unquoted -- separator (Unix/macOS).
  • Added dedicated notes specifically clarifying that on Windows (Command Prompt and PowerShell), the -- separator must be enclosed in quotation marks ("--"), with accompanying Windows examples.

The commit has been amended and force-pushed.

Comment thread www/docs/en/latest/guide/cli/index.md Outdated
> ```bash
> cordova build android --release "--" --packageType=apk
> ```
> See the [Android Platform Guide](../../guide/platforms/android/index.html#signing-an-app) and [iOS Platform Guide](../../guide/platforms/ios/index.html) for available platform-specific flags.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the Android Platform Guide and iOS Platform Guide for available platform-specific flags.

Should not be in the note, since this is a general information of the Passing Platform-Specific Arguments section and not specific to Windows. You could add this under See Also:. Also link the Android Platform Guide to just index.html as you did for iOS.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add to Example: the platforms the example is for, like **Example Unix/macOS:**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add to Example: the platforms the example is for, like Example Unix/macOS:

cordova run android -- --gradleArg=-PcdvMinSdkVersion=20
```

_**Note:** The example above is for Unix/macOS shells. On Windows (Command Prompt and PowerShell), the intermediate `--` separator must be enclosed in quotation marks (`"--"`), e.g. `cordova run android "--" --gradleArg=-PcdvMinSdkVersion=20`._

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same style as of for www/docs/en/latest/guide/cli/index.md like:

> **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, for example:
> ```bash
> cordova build android --release "--" --packageType=apk
> ```

By default, JVM args has a value of `-Xmx2048m`. To increase the maximum allowed memory, use the `-Xmx` JVM arg. Example given below:

```
```bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add **Example Unix/macOS:** here

@@ -611,7 +613,14 @@ _**Note**: You should use double `--` to indicate that these are platform-specif

Example:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the platforms of the example here Example (Unix/macOS):


**Note**: You should use double `--` to indicate that these are platform-specific arguments, for example:

`cordova run ios --release -- --codeSignIdentity="iPhone Developer" --developmentTeam=FG35JLLMXX4A --packageType=development`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Example (Unix/macOS): here

cordova run android -- --gradleArg=-PcdvMinSdkVersion=20
```

_**Note:** The example above is for Unix/macOS shells. On Windows (Command Prompt and PowerShell), the intermediate `--` separator must be enclosed in quotation marks (`"--"`), e.g. `cordova run android "--" --gradleArg=-PcdvMinSdkVersion=20`._

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than explaining each time the "--" exception for Windows, you could directly add an example for Windows like:

**Example Windows:**

```bash
cordova run android "--" --gradleArg=-PcdvMinSdkVersion=20

…ache#1336)

- Keep standard CLI examples using unquoted -- separator
- Add dedicated notes explaining the quotation requirement ("--") for Windows (Command Prompt and PowerShell)
- Add Passing Platform-Specific Arguments section to the Cordova CLI guide with notes for Windows users
- Fixes apache#1336
@rishi919-rgb
rishi919-rgb force-pushed the fix-windows-cli-passthrough-args branch from 7ae7767 to 9cf359a Compare September 27, 2026 12:45
@rishi919-rgb

Copy link
Copy Markdown
Author

Thanks again for the thorough review and helpful suggestions @GitToTheHub!

I have updated the PR to incorporate all of your feedback:

  • **\guide/cli/index.md**: Removed the platform guide links from the Windows note blockquote and added them under See Also: (linking Android to \index.html\ like iOS).
  • **\platforms/android/index.md**:
    • Replaced verbose explanation notes with direct **Example (Windows):\ code blocks alongside **Example (Unix/macOS):\ across the --gradleArg, --jvmargs, and signing sections.
    • Clarified the environment variable example header to **Example (Unix/macOS):**.
  • \platforms/ios/index.md**: Updated the example header to **Example (Unix/macOS):\ and removed the unnecessary Windows note.

The commit has been amended and force-pushed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve CLI usage documentation on windows

2 participants