### Install Cordova CLI (Windows) Source: https://github.com/apache/cordova-cli/blob/master/README.md Installs the Cordova CLI globally on a Windows system using npm. ```bash c:\> npm install -g cordova ``` -------------------------------- ### List Installed Plugins Source: https://github.com/apache/cordova-cli/blob/master/doc/plugin.txt This command lists all plugins currently installed in the project. ```bash cordova-cli plugin ls ``` -------------------------------- ### Install Cordova CLI (Mac OS X/Linux) Source: https://github.com/apache/cordova-cli/blob/master/README.md Installs the Cordova CLI globally on a Mac OS X or Linux system using npm with sudo privileges. ```bash $sudo npm install -g cordova ``` -------------------------------- ### Add Plugin from Local Directory Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Install a plugin directly from a local directory on your filesystem. This is useful for testing local plugin development. The plugin is saved to `config.xml` and `package.json`. ```bash cordova plugin add ../cordova-plugin-camera ``` -------------------------------- ### Get Help for Cordova Commands Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Displays a syntax summary or detailed help for a specific Cordova command. ```bash cordova help [command] ``` ```bash cordova [command] -h ``` ```bash cordova -h [command] ``` -------------------------------- ### Build for Android in Release Mode with Custom Build Configuration Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Example of building the Android platform in release mode, utilizing a specific build configuration file located at `../myBuildConfig.json`. ```bash cordova build android --release --buildConfig=..\myBuildConfig.json ``` -------------------------------- ### List Installed Plugins Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Display a list of all plugins currently installed in your Cordova project. This command provides a quick overview of the project's plugin dependencies. ```bash cordova plugin ls ``` -------------------------------- ### Build for Android and iOS in Debug Mode for Device Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Example of building for multiple platforms (`android`, `ios`) in debug mode, intended for deployment to a physical device. ```bash cordova build android ios --debug --device ``` -------------------------------- ### List Cordova Platforms Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Lists all installed and available platforms for the Cordova project, including their version numbers. This is useful for reporting issues. ```bash cordova platform ls ``` -------------------------------- ### Serve Cordova Project Assets Locally Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Starts a local web server to serve www/ assets, accessible at `http://HOST_IP:PORT/PLATFORM/www`. A port can be specified, otherwise defaults to 8000. ```bash cordova serve [port] ``` -------------------------------- ### Manage Global Cordova Configuration Options Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Provides commands to list, edit, set, get, or delete global Cordova configuration options. ```bash cordova config ls ``` ```bash cordova config edit ``` ```bash cordova config set save-exact true ``` ```bash cordova config get save-exact ``` ```bash cordova config delete save-exact ``` -------------------------------- ### Add Plugin from Tarball Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Install a plugin from a local tarball archive. This method is useful for distributing or installing plugins that are packaged as `.tgz` files. The plugin is saved to `config.xml` and `package.json`. ```bash cordova plugin add ../cordova-plugin-camera.tgz ``` -------------------------------- ### Install Cordova Bash Completion on Linux/BSD Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md Copy the completion script to the bash completion directory for system-wide availability. This takes effect on the next shell startup. ```bash sudo cp scripts/cordova.completion /etc/bash_completion.d/ ``` -------------------------------- ### Get Cordova Project Information Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Prints essential information about the Cordova project, which is helpful for debugging and submitting bug reports. ```bash cordova info ``` -------------------------------- ### Get Cordova Config Option Source: https://github.com/apache/cordova-cli/blob/master/doc/config.txt Use this command to retrieve the value of a specific global Cordova configuration option. The value is echoed to standard output. ```bash cordova config get save-exact ``` -------------------------------- ### Tab Completion for Specific Plugin Removal Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md When removing a plugin, you can use tab completion to find specific plugin identifiers, such as those starting with 'org.apache.cordova.' ```bash $cordova plugin rm org.apache.cordova. ``` -------------------------------- ### Add a Cordova Plugin Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Install a plugin into your Cordova project using the 'plugin add' command. The '--nosave' option prevents the plugin from being added to the cordova/config.xml file. ```bash cordova-cli plugin add cordova-plugin-camera ``` ```bash cordova-cli plugin add cordova-plugin-camera --nosave ``` -------------------------------- ### Tab Completion for Cordova Plugin Remove Targets Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md Use tab completion after 'cordova plugin rm ' to list installed plugins or plugin identifiers for removal. ```bash $cordova plugin rm ``` -------------------------------- ### Create and Build Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/README.md Demonstrates the steps to create a new Cordova project, add a plugin, add a platform, check requirements, build for Android, and run the application. ```bash cordova create myApp com.myCompany.myApp myApp cd myApp cordova plugin add cordova-plugin-camera --save cordova platform add android --save cordova requirements android cordova build android --verbose cordova run android ``` -------------------------------- ### Run Project on Android Platform Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Build and deploy the project to an Android device or emulator. This command includes the prepare and compile steps. ```bash cordova run android ``` -------------------------------- ### Create a Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Use the 'create' command to initialize a new Cordova project. Specify the project directory, package name, and application name. ```bash cordova-cli create myApp org.apache.cordova.myApp myApp ``` -------------------------------- ### Build Android Project for Release with Signing Parameters Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Build the Android project for release, including signing parameters. The '--' separator is used to pass platform-specific options like keystore details. ```bash cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey ``` -------------------------------- ### Create a Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Initializes the directory structure for a new Cordova project. Specify the path, an optional ID, and an optional name for your application. ```bash cordova create myapp com.mycompany.myapp MyApp ``` -------------------------------- ### Run a Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Execute the 'run' command to prepare, compile, and deploy the Cordova project to a device or emulator. ```bash cordova-cli run android ``` -------------------------------- ### Create a Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Use this command to create a new Cordova project. Navigate into the created project directory to manage it. ```bash cordova create myApp com.myCompany.myApp myApp cd myApp ``` -------------------------------- ### Add Plugins with Search Path Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Use this command to add multiple plugins to your project and specify directories to search for them before checking the registry. The plugin specifications are saved to `config.xml` and `package.json` by default. ```bash cordova plugin add cordova-plugin-camera cordova-plugin-file --searchpath ../plugins ``` -------------------------------- ### Check Platform Requirements Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Verify that your system is configured with the necessary requirements for a specific platform. This is crucial before building or running. ```bash cordova requirements android ``` -------------------------------- ### Check Project Requirements Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Verify that all necessary requirements for specified platforms are met using the 'requirements' command. ```bash cordova-cli requirements android ``` -------------------------------- ### Prepare Cordova Project for Platforms Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Transforms config.xml metadata to platform-specific manifest files and copies necessary assets. If no platforms are specified, all platforms are prepared. ```bash cordova prepare [ [..]] ``` -------------------------------- ### Build a Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Compile the Cordova project for a specific platform. Use the '--verbose' option for detailed output. The '--release' option builds a release version. ```bash cordova-cli build android --verbose ``` ```bash cordova-cli build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey ``` -------------------------------- ### Build Project for Android with Verbose Logging Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Build the project for the Android platform. The --verbose option provides more detailed output during the build process. ```bash cordova build android --verbose ``` -------------------------------- ### Cordova CLI Syntax Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md This is the general syntax for using Cordova CLI commands. It includes the base command, the specific command to execute, optional arguments, and platform-specific options. ```bash cordova [options] -- [platformOpts] ``` -------------------------------- ### List Available Targets for iOS Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Enumerates all connected devices and available emulators that can be used for running the Cordova app on iOS. ```bash cordova run ios --list ``` -------------------------------- ### List Cordova Config Contents Source: https://github.com/apache/cordova-cli/blob/master/doc/config.txt Displays the contents of the global Cordova configuration file. ```bash cordova config ls ``` -------------------------------- ### Manage Global Cordova Configuration Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Use the 'config' command to manage global Cordova settings. The 'ls' subcommand lists all current global configurations. ```bash cordova-cli config ls ``` -------------------------------- ### Check Cordova Platform Requirements Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Verifies and displays all requirements for specified platforms, exiting with a non-zero code if any requirements are not met. Useful for setting up build environments. ```bash cordova requirements [platform?] ``` -------------------------------- ### Add Plugin with Specific Options Source: https://github.com/apache/cordova-cli/blob/master/doc/plugin.txt Use this command to add plugins to your project, with options to control saving to config.xml and package.json, and to specify search paths. The --nosave flag prevents automatic saving. ```bash cordova-cli plugin add cordova-plugin-camera cordova-plugin-file --nosave --searchpath ~/plugins ``` ```bash cordova-cli plugin add cordova-plugin-camera@^2.0.0 --nosave ``` ```bash cordova-cli plugin add https://github.com/myfork/cordova-plugin-camera.git#2.1.0 --nosave ``` ```bash cordova-cli plugin add ../cordova-plugin-camera --nosave ``` ```bash cordova-cli plugin add ../cordova-plugin-camera.tgz --nosave ``` -------------------------------- ### Run Cordova Project on Android Emulator with Build Configuration Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Executes a release build of the Cordova project on a specified Android emulator, using a custom build configuration file. ```bash cordova run android --release --buildConfig=..\myBuildConfig.json --target=Nexus_5_API_23_x86 ``` -------------------------------- ### Build Cordova Project for Platforms Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Builds the Cordova app for specified platforms, combining prepare and compile steps. Options include debug/release modes, targeting devices or emulators, and specifying build configurations. ```bash cordova build [ [...]] [--debug | --release] [--device | --emulator] [--buildConfig=] [-- ] ``` -------------------------------- ### Compile Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Compiles the Cordova project for specified platforms without performing the prepare step. This command is a subset of `cordova build` and is useful for extending build processes with hooks. ```bash cordova compile [ [...]] [--debug | --release] [--device | --emulator | --target=] [--buildConfig=] [-- ] ``` -------------------------------- ### Tab Completion for Cordova Platform Add Targets Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md After typing 'cordova platform add ', use tab completion to list available platforms that can be added to your project. ```bash $cordova platform add ``` -------------------------------- ### Add Plugin to Project Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Add a Cordova plugin to your project using the 'plugin add' command. Ensure the plugin name is correct. ```bash cordova plugin add cordova-plugin-camera ``` -------------------------------- ### Basic Cordova Command Tab Completion Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md Initiate tab completion by typing 'cordova' followed by a tab. This displays available top-level Cordova commands. ```bash $cordova ``` -------------------------------- ### Tab Completion for Cordova Platform Commands Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md Use tab completion after 'cordova platform' to see available subcommands like 'add' or 'remove'. ```bash $cordova platform ``` -------------------------------- ### Run Cordova Project on iOS Device Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Deploys a debug build of the Cordova project to a connected iOS device. ```bash cordova run ios --device ``` -------------------------------- ### Add Platform to Project Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Add a target platform to your Cordova project using the 'platform add' command. This prepares the project for building on that platform. ```bash cordova platform add android ``` -------------------------------- ### Set Cordova Config Option Source: https://github.com/apache/cordova-cli/blob/master/doc/config.txt Use this command to set a global Cordova configuration option. If the value is omitted, it defaults to 'true'. ```bash cordova config set save-exact true ``` -------------------------------- ### Add Plugin with Version Specifier Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Add a specific version of a plugin using semantic versioning (semver). This ensures compatibility with your project by pinning to a particular version range. The plugin is saved to `config.xml` and `package.json`. ```bash cordova plugin add cordova-plugin-camera@^2.0.0 ``` -------------------------------- ### Run Cordova Project on Android, Skipping Build Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Deploys a debug build of the Cordova project to Android, skipping the build step. Useful when only deployment is needed. ```bash cordova run android --nobuild ``` -------------------------------- ### Remove Plugin and Configuration Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Remove a plugin from your project and also remove its entry from `config.xml` and `package.json`. This performs a complete removal of the plugin and its saved configuration. ```bash cordova plugin rm camera ``` -------------------------------- ### Configure Cordova Bash Completion on OS X Source: https://github.com/apache/cordova-cli/blob/master/doc/bash.md Place the completion script in a readable location and source it in your .bashrc file. This enables completion for subsequent shell sessions. ```bash source /cordova.completion ``` -------------------------------- ### Add Cordova Platforms Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Manages Cordova platforms, allowing you to add, remove, update, and list them. Use '--save' to persist changes to config.xml and package.json. ```bash cordova platform add android ios ``` ```bash cordova platform add android@^5.0.0 ``` ```bash cordova platform add https://github.com/myfork/cordova-android.git#4.0.0 ``` ```bash cordova platform add ../android ``` ```bash cordova platform add ../cordova-android.tgz ``` -------------------------------- ### Edit Cordova Config File Source: https://github.com/apache/cordova-cli/blob/master/doc/config.txt Opens the global Cordova configuration file in your default text editor for manual editing. ```bash cordova config edit ``` -------------------------------- ### Clean Android Platform Build Artifacts Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Removes build artifacts for the Android platform, ensuring a clean build environment. ```bash cordova clean android ``` -------------------------------- ### Remove Plugin Without Saving Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Remove a plugin from your project but keep its entry in `config.xml` and `package.json`. Use this if you intend to re-add the plugin later without needing to re-specify its configuration. ```bash cordova plugin rm camera --nosave ``` -------------------------------- ### Add a Platform to a Cordova Project Source: https://github.com/apache/cordova-cli/blob/master/doc/cordova.txt Add a target platform to your Cordova project using the 'platform add' command. The '--nosave' option prevents the platform from being added to the cordova/config.xml file. ```bash cordova-cli platform add android ``` ```bash cordova-cli platform add android --nosave ``` -------------------------------- ### Remove Cordova Platform Source: https://github.com/apache/cordova-cli/blob/master/doc/readme.md Removes a specified platform from the Cordova project. Use '--nosave' to prevent removal from config.xml and package.json. ```bash cordova platform rm android ``` ```bash cordova platform rm android --nosave ``` -------------------------------- ### Remove Plugin Source: https://github.com/apache/cordova-cli/blob/master/doc/plugin.txt Use this command to remove plugins by their ID or name. The --nosave flag prevents removal of plugin information from config.xml and package.json. ```bash cordova-cli plugin rm camera --nosave ``` -------------------------------- ### Delete Cordova Config Option Source: https://github.com/apache/cordova-cli/blob/master/doc/config.txt Use this command to remove a global Cordova configuration option from all configuration files. ```bash cordova config delete save-exact ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.