The Basics

Apps built using PhoneGap Build can be set up either through our web interface, or by using a config.xml.

The config.xml file, as specified in the W3C widget specification , allows developers to easily specify metadata about their applications. You can see a sample config.xml with our PhoneGap Start application.

Please ensure that your config.xml file is at the top level of your application (the same level as your index.html file). Otherwise it will not be loaded correctly.

We're continually adding features to our config.xml support to give PhoneGap Build developers more power to customize their apps. If there are any specific features you'd like to see support for, please let us know.

Essential Properties

<widget>

The widget element must be the root of your XML document - it lets us know that you are following the W3C specification. When using PhoneGap Build, ensure you have the following attributes set on your widget element

id: the unique identifier for your application. To support all supported platforms, this *must* be reverse-domain name style (e.g. `com.yourcompany.yourapp`)

version: for best results, use a major/minor/patch style version, with three numbers, such as `0.0.1`

versionCode: (optional) when building for Android, you can set the versionCode by specifying it in your *config.xml*. For more information on Android's versionCode attribute, see [the Android documentation](http://developer.android.com/guide/publishing/versioning.html).

<name>

The name of the application.

<description>

A description for your application.

Example Config.xml

<?xml version="1.0" encoding="UTF-8" ?>
    <widget xmlns   = "http://www.w3.org/ns/widgets"
        xmlns:gap   = "http://phonegap.com/ns/1.0"
        id          = "com.phonegap.example"
        versionCode = "10" 
        version     = "1.0.0" >

    <!-- versionCode is optional and Android only -->

    <name>PhoneGap Example</name>

    <description>
        An example for phonegap build docs. 
    </description>

    <author href="https://build.phonegap.com" email="support@phonegap.com">
        Hardeep Shoker 
    </author>

</widget>

Platform Build Selection

By default PhoneGap Build builds your application for every platform. If you only want to build for certain platforms you can specify these platforms with the gap:platform tag.

<gap:platform>

You can have zero or more of these elements present in your config.xml. If you specify none, all platforms will be built.

name: platform to build - one of android, ios, winphone

Example Usage

<gap:platform name="ios" />
<gap:platform name="android" />
<gap:platform name="winphone" />