--- license: > Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. title: Plugin.xml reference documentation toc_title: Plugin.xml description: List of supported tags in the plugin.xml file. --- # Plugin.xml Plugin.xml file defines the structure and settings required for your plugin. It has several elements to provide details about your plugin. # plugin The `plugin` element is the plugin manifest's top-level element. Attributes(type)
Only for platform: | Description ---------------- | ------------ xmlns(string) | *Required*
The plugin namespace, `http://apache.org/cordova/ns/plugins/1.0`. If the document contains XML from other namespaces, such as tags to be added to the `AndroidManifest.xml` file in the case of Android, those namespaces should also be included in the element. id(string) | *Required*
A npm-style identifier for the plugin. version(string) | *Required*
A version number for the plugin. [Semver](http://semver.org/) syntax is supported. Example: ```xml ``` ## engines and engine The child elements of the `` element specify versions of Apache Cordova-based frameworks that this plugin supports. The CLI aborts with a non-zero code for any plugin whose target project does not meet the engine's constraints. If no tags are specified, the CLI attempts to install into the specified cordova project directory blindly. >NOTE: In **Cordova 6.1.0+**, the recommended place to specify platform, plugin, and CLI dependencies >is in a plugin's `package.json`. See [specifying Cordova dependencies](../guide/hybrid/plugins/index.html#specifying-cordova-dependencies) >for more information Attributes(type)
Only for platform: | Description ---------------- | ------------ name(string) | *Required*
Name of the engine. Here are the default engines that are supported :
  • `cordova`
  • `cordova-plugman`
  • `cordova-android`
  • `cordova-browser`
  • `cordova-ios`
  • `cordova-windows`
  • `cordova-osx`
  • `windows-os`
  • `android-sdk` (returns the highest Android api level installed)
  • `windows-sdk` (returns the native windows SDK version)
  • `apple-xcode` (returns the xcode version)
  • `apple-ios` (returns the highest iOS version installed)
  • `apple-osx` (returns the OSX version)
  • You can also specify a custom framework apart from the default ones. version(string) | *Required*
    The version that your framework must have in order to install. Semver syntax is supported. scriptSrc(string) | **For custom frameworks only**
    *Required*
    The script file that tells plugman the version of the custom framework. Ideally, this file should be within the top level directory of your plugin directory. platform(string) | **For custom frameworks only**
    *Required*
    The platforms your framework supports. You may use the wildcard `*` to say supported for all platforms, specify multiple with a pipe character like `android|ios` or just a single platform like `android`. Examples: ```xml ``` Engine elements may also specify fuzzy matches using '>', '>=' etc. to avoid repetition, and to reduce maintenance when the underlying platform is updated. ```xml ``` The `` tags also has default support for all of the main platforms Cordova exists on. Specifying the cordova engine tag means that all versions of Cordova on any platform must satisfy the engine version attribute. You may also list specific platforms and their versions in order to override the catch-all cordova engine: ```xml ``` Custom frameworks example: ```xml ``` ## name The `name` element is used to specify the name of the plugin. This element does not (yet) handle localization. Example: ```xml Foo ``` ## description The `description` element is used to specify the description of the plugin. This element does not (yet) handle localization. Example: ```xml Foo plugin description ``` ## author The content of the `author` element contains the name of the plugin author. Example: ```xml Foo plugin author ``` ## keywords The content of the `keywords` element contains comma separated keywords to describe the plugin. Example: ```xml foo,bar ``` ## license This element is used to specify the license of the plugin. Example: ```xml Apache 2.0 License ``` ## asset This element is used to list the files or directories to be copied into a Cordova app's `www` directory. Any `` elements that are nested within `` elements specify platform-specific web assets. Attributes(type)
    Only for platform: | Description ---------------- | ------------ src(string) | *Required*
    Where the file or directory is located in the plugin package, relative to the `plugin.xml` document. If a file does not exist at the specified src location, the CLI stops and reverses the installation process, issues a notification about the conflict, and exits with a non-zero code. target(string) | *Required*
    Where the file or directory should be located in the Cordova app, relative to the `www` directory. If a file already exists at the target location, the CLI stops and reverses the installation process, issues a notification about the conflict, and exits with a non-zero code. Examples: ```xml ``` Assets can be targeted to subdirectories as well. This will create the `js/experimental` directory within the `www` directory, unless already present, and copy the `new-foo.js` file and renames it to `foo.js`. ```xml ``` ## js-module Most plugins include one or more JavaScript files. Each `` tag corresponds to a JavaScript file, and prevents the plugin's users from having to add a `