- Creating an App
- CLI Commands
- Platform Support
- Platform Pinning
- Version Management
- Splash Screen
- Allow List
- Data Storage
- Create a Plugin
- Use Plugman
- Config.xml API
- Plugin.xml API
- Third-party Tools
- App Templates
- Next Steps
- Battery Status
- Media Capture
- Network Information
- Screen Orientation
- Browser Splashscreen
- Embed Cordova in native apps
Cordova CLI 12.x & Higher
Starting from Cordova CLI 12.0.0, the CLI no longer maintains a list of pinned Apache Cordova platforms.
When you run the
cordova platform add <PLATFORM> command, it will always fetch the latest available platform from the npm registry. This ensures immediate access to newly released platforms.
If you want to consistently fetch a specific version, you need to modify the command and include the version pinning. For example, use
cordova platform add <PLATFORM>@<VERSION>.
cordova platform list command displays the list of platforms without their versions. However, it will continue to show the versions of the installed platforms.
$ cordova platform list Installed platforms: android 12.0.0 Available platforms: browser electron ios
Cordova CLI 11.x & Lower
Cordova CLI 11.x and lower versions still use platform pinning but won't receive further updates since Cordova CLI 12.0.0 has been released. Platforms are pinned with a
^ symbol, allowing the CLI to fetch new minor and patch releases for the pinned platforms.
To view the pinned platforms for your CLI version, run the command
cordova platform list in a new project directory.
$ cordova platform list Installed platforms: Available platforms: android ^10.1.1 browser ^6.0.0 electron ^3.0.0 ios ^6.2.0 osx ^6.0.0 (deprecated)
Based on the above information, executing
cordova platform add android will fetch the latest minor/patch release version starting from 10.1.1 or higher. If you specify a version, it will fetch the specified version. For example,
cordova platform add email@example.com will fetch Cordova iOS 5.0.1.
Note: After installing a platform, the "Installed platforms:" section will display the actual installed platform version. The installed platform will no longer appear in the "Available platforms:" section until it is removed from the project.