In this tutorial we will create a config.xml file from scratch for PhoneGap Build apps. The config.xml file is the most essential part of a PhoneGap Build app without it you will not be able to use the build service to build you apps.
All apps must have one config.xml file located at the root of the app.We took a look at the sample app that we will be using in the this video here. Let’s take the following folder structure for example
Notice that I have placed the config.xml file at the root of our folder along side the index.html file.
We will get started by putting the following XML code in the config.xml file. You can read more about this in the documentation here.
<?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 = "1"
version = "1.0.0" >
<!-- versionCode is Android only -->
<!-- version is in major.minor.patch format -->
<name>PhoneGap Example App</name>
An example for phonegap build app which wont show up in the playstore.
<author href="https://YourWebsite.com" email="[email protected]">
Name Of The Author
We are creating the
<?xml ?> tag on line 1 and this is a standard xml tag.
Next we are creating a
widget tag which has
xmlns:gap attribute which are for XML namespace.
id attribute inside of the
widget tag is used to uniquely identify the app on the PlayStore/iTunes and should be unique for every app and must be in the reverse domain notation.
versionCode attribute is used by android only to identify different versions of the same app, so if you publish an app with
versionCode=1 when you push an update to that app you will need to increment the number so for the next update you have to put
versionCode=2 and so on.
version attribute follows the standard version system which is [major].[minor].[build]
name tag is the name of your app. This is not the name that will be used in the PlayStore/iTunes but it will be the name of the app on a device.
author tags are used by PhoneGap build and are pretty self explanatory.
Watch Video Tutorial Here:
The config.xml file is a must for any PhoneGap build App, as a matter of fact it is also a must for apps that are built using the Cordova CLI and PhoneGap CLI as well.