---
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: Config.xml
description: List of supported tags in the config.xml file.
---
# 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)](http://www.w3.org/TR/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](../guide/cli/index.html)), 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](images.html) for more information.
# widget
Root element of the config.xml document.
Attributes(type)
| Description
---------------- | ------------
id(string) | *Required*
Specifies the app's reverse-domain identifier.
version(string) | *Required*
Full version number expressed in major/minor/patch notation.
android-versionCode(string)
==Android== | Alternative version for Android. Sets the [version code](http://developer.android.com/tools/publishing/versioning.html) for the application. See [the Android guide](../guide/platforms/android/index.html#setting-the-version-code) for information on how this attribute may be modified.
defaultlocale
==iOS== | Specified the default language of the app, as an IANA language code.
android-packageName(string)
==Android== | Alternative package name for Android, overrides `id`.
android-activityName(string)
==Android== | Set the activity name for your app in AndroidManifest.xml. Note that this is only set once after the Android platform is first added.
ios-CFBundleIdentifier(string)
==iOS== | Alternative bundle id for iOS. Overrides `id`.
ios-CFBundleVersion(string)
==iOS== | Alternative version for iOS. For further details, see [iOS versioning](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102364).
osx-CFBundleVersion(string)
==OS X== | Alternative version for OS X. For further details, see [OS X versioning](https://developer.apple.com/library/prerelease/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102364).
windows-packageVersion(string)
==Windows== | Alternative version for Windows. For futher details, see [Windows versioning](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx)
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:
```xml
```
## name
Specifies the app's formal name, as it appears on the device's home screen and within app-store interfaces.
Examples:
```xml
HelloCordova
```
### short name
Specifies an optional display name for the app. Sometimes the app name should be displayed differently on device's home screen than on informational and app-store interfaces due to limited space.
Examples:
```xml
HelloCordova
```
## description
Specifies metadata that may appear within app-store listings.
Examples:
```xml
A sample Apache Cordova application
```
## author
Specifies contact information that may appear within app-store listings.
Attributes(type)
| Description
----------------- | ------------
email(string) | *Required*
Email of the author.
href(string) | *Required*
Website of the author.
Examples:
```xml
```
## content
Defines the app's starting page in the top-level web assets directory. The default value is index.html, which customarily
appears in a project's top-level ```www``` directory.
Attributes(type)
| Description
----------------- | ------------
src(string) | *Required*
Defines the app's starting page in the top-level web assets directory. The default value is index.html, which customarily
appears in a project's top-level ```www``` directory.
Examples:
```xml
```
## access
Defines the set of external domains the app is allowed to communicate with. The default value shown above allows it to access any server.
See the Domain [Whitelist Guide](../guide/appdev/whitelist/index.html) for details.
Attributes(type)
| Description
----------------- | ------------
origin(string) | *Required*
Defines the set of external domains the app is allowed to communicate with.
The default value shown above allows it to access any server.
See the Domain [Whitelist Guide](../guide/appdev/whitelist/index.html) for details.
Examples:
```xml
```
## allow-navigation
Controls which URLs the WebView itself can be navigated to. Applies to top-level navigations only.
Attributes(type)
| Description
----------------- | ------------
href(string) | *Required*
Defines the set of external domains the WebView is allowed to navigate to.
See the cordova-plugin-whitelist [cordova-plugin-whitelist][whitelist_navigation] for details.
Examples:
```xml
```
## allow-intent
Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed.
Attributes(type)
| Description
----------------- | ------------
href(string) | *Required*
Defines which URLs the app is allowed to ask the system to open.
See the cordova-plugin-whitelist [cordova-plugin-whitelist][whitelist_intent] for details.
Examples:
```xml
```
## edit-config
See [ docs][edit_config] for plugin.xml.
## config-file
See [ docs][config_file] for plugin.xml.
## engine
Specifies details about what platform to restore during a prepare.
Attributes(type)
| Description
----------------- | ------------
name(string) | *Required*
Name of the platform to be restored
spec(string) | *Required*
Details about the platform to be restored. This could be a ```major.minor.patch``` version number, a directory containing the platform or a url pointing to a git repository. This information will be used to retrieve the platform code to restore from NPM, a local directory or a git repository. See [Platform Spec][platform_spec] for further details.
Examples:
```xml
```
## plugin
Specifies details about what plugin to restore during a prepare. This element
is automatically added to a project's `config.xml` when a plugin is added using
the `--save` flag. See the [CLI reference][plugin_cli] for more information on
adding plugins.
Attributes(type)
| Description
----------------- | ------------
name(string) | *Required*
Name of the plugin to be restored
spec(string) | *Required*
Details about the plugin to be restored. This could be a ```major.minor.patch``` version number, a directory containing the plugin or a url pointing to a git repository. This information will be used to retrieve the plugin code to restore from NPM, a local directory or a git repository. See [Plugin Spec][plugin_spec] for further details.
Examples:
```xml
```
### variable
Persists the value of a CLI variable to be used when restoring a plugin during a
prepare. This element is added to `config.xml` when a plugin that uses CLI variables
is added using the `--save` flag. See the [CLI reference][plugin_cli] for more
information on adding plugins.
Note that this value is only used when the plugin is restored to the project during a
prepare, changing it will *not* change the value used by the plugin in the current
project. In order for changes to this value to take effect, remove the plugin from the
project and restore it by running `cordova prepare`. See the
[preference element][plugin_preference] of `plugin.xml` for more details on CLI variables.
Attributes(type)
| Description
----------------- | ------------
name(string) | *Required*
Name of the CLI variable. Can only contain capital letters, digits, and underscores.
value(string) | *Required*
Value of the CLI variable to be used when restoring the parent plugin during a prepare.
Examples:
```xml
```
## preference
Sets various options as pairs of name/value attributes. Each preference's name is case-insensitive. Many preferences are unique to specific platforms,
and will be indicated as such.
Attributes(type)
| Description
----------------- | ------------
AllowInlineMediaPlayback(boolean)
==iOS== | *Default: false*
Set to true to allow HTML5 media playback to appear inline within the screen layout, using browser-supplied controls rather than native controls. For this to work, add the ```playsinline``` attribute to any ```