Config.xml
Config.xml is a global configuration file that controls many aspects of a cordova application's behavior. This platform-agnostic XML file is arranged based on the W3C's Packaged Web Apps (Widgets) specification, and extended to specify core Cordova API features, plugins, and platform-specific settings.
For projects created with the Cordova CLI (described in The Command-Line Interface), this file can be found in the top-level directory:
app/config.xml
Note that before version 3.3.1-0.2.0, the file existed at app/www/config.xml
, and that having it here is still supported.
When using the CLI to build a project, versions of this file are passively copied into various platforms/
subdirectories. For example:
app/platforms/ios/AppName/config.xml app/platforms/blackberry10/www/config.xml app/platforms/android/res/xml/config.xml
In addition to the various configuration options detailed below, you can also configure an application's core set of images for each target platform. See Customize icons topic for more information.
widget
Root element of the config.xml document.
Attributes(type) Only for platform: | Description |
---|---|
id(string) |
Required Specifies the app's reverse-domain identifier, and the version its full version number expressed in major/minor/patch notation. |
version(string) |
Required Full version number expressed in major/minor/patch notation. |
android-versionCode(string) Android | Alternative version for Android. Sets the version code for the application. See the Android guide for information on how this attribute may be modified. |
defaultlocale iOS | Specified the default language of the app, as an IANA language code. |
ios-CFBundleVersion(string) iOS | Alternative version for iOS. For further details, see iOS versioning. |
osx-CFBundleVersion(string) OS X | Alternative version for OS X. For further details, see OS X versioning. |
windows-packageVersion(string) Windows | Alternative version for Windows. For futher details, see Windows versioning |
packageName(string) Windows |
Default: Cordova.Example Package name for Windows. |
xmlns(string) |
Required Namespace for the config.xml document. |
xmlns:cdv(string) |
Required Namespace prefix. |
Examples:
<!-- Android --> <widget id="io.cordova.hellocordova" version="0.0.1" android-versionCode="13" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> </widget> <!-- iOS --> <widget id="io.cordova.hellocordova" version="0.0.1" ios-CFBundleVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> </widget> <!-- Windows --> <widget id="io.cordova.hellocordova" version="0.0.1" windows-packageVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> </widget> <!-- OS X --> <widget id="io.cordova.hellocordova" version="0.0.1" osx-CFBundleVersion="0.1.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> </widget>
Please login to continue.