PhoneGap Build offers easy iOS and Android builds without the need to install any SDK’s. To debug an app in iOS you simply create an Ad Hoc Provisioning Profile, upload it to PhoneGap Build, and then create your app. When its time to build for production you then provide a Distribution Provisioning Profile and PhoneGap Build creates your IPA ready for the App Store. On Android – you don’t have the option of providing a debug or release key as PhoneGap Build will always create a release build from the key that you provide.

In a normal PhoneGap CLI-based setup you would edit Android’s manifest.xml by adding the following attribute to the <application> element.

android:debuggable="true"

PhoneGap Build lets you edit the Android Manifest indirectly via a special-purpose element within the PhoneGap Build config.xml document. The element in question takes this form:


 

Any valid android manifest elements that you add within the above will have its attribute values over-ride its matching element’s attributes in the final manifest. In addition, if you provide an element within the above that doesn’t exist in the build’s manifest then that element will be inserted.

Since the android:debuggable attribute lives within the <application> element then all we need to do to enable debugging is the following:


    

In order for the above to work you **must** add the Android XML namespace to the widget element of your config.xml:

xmlns:android = "http://schemas.android.com/apk/res/android"

So then, a valid widget element would look like this:

The above was tested to work with PhoneGap Build CLI 6.3.0.

For additional information see the PhoneGap documentation.

For additional information re the Android manifest’s <application> element see the relevant documentation.