capacitor-set-version is a command-line interface (CLI) tool designed for Capacitor and Ionic projects to programmatically update application version and build numbers for both Android and iOS platforms. It specifically targets Android's `versionCode` and iOS's `CFBundleVersion` for the build number, alongside the human-readable version string. The current stable version is 2.2.0, with releases occurring on an irregular basis, typically in response to bug fixes or new platform features like Kotlin DSL support for Android. This utility is distinct from general-purpose versioning tools by being tightly integrated with Capacitor's project structure, allowing developers to manage native platform versioning directly from their JavaScript/TypeScript development workflow. It serves as a crucial tool in CI/CD pipelines for automating release processes by ensuring consistency in version numbers across platforms.
npm install capacitor-set-versionVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation, basic usage for both platforms, and platform-specific version setting using `npx` or installed CLI, including a CI/CD-friendly example.
Review the 'Migrating from version 1.x.x' section in the README. Manually pass `--version` and `--build` flags, as auto-increment and package.json reading are no longer supported.
Update your scripts to use `capacitor-set-version set:ios` or `capacitor-set-version set:android` instead of the old flags.
Always provide a value for `-v` and `-b` when running `capacitor-set-version` or its subcommands.
Ensure you are on a recent patch release (e.g., >=1.3.32 or >=2.0.1) if encountering issues with iOS build number formats. The CLI handles conversion internally.
Add the `-v <version_number>` flag to your command. Example: `capacitor-set-version -v 1.0.0 -b 100`.
Add the `-b <build_number>` flag to your command. Example: `capacitor-set-version -v 1.0.0 -b 100`.
Replace `--android` with `set:android` and `--ios` with `set:ios`. Example: `capacitor-set-version set:android -v 1.0.0 -b 100`.
The auto-increment feature is no longer supported. You must manually provide the desired version and build numbers using the `-v` and `-b` flags.
No dependency data recorded yet.