Building Ionic 2 Beta 7 Apps With PhoneGap Build

Thought I’d post the instructions here in case it helps anyone:

  • Copy the resources folder from the root directory and paste it into the www folder.

  • Copy the config.xml file from the root directory and paste it into the www folder.

  • Open the newly pasted config.xml file and delete the entire xmlns:cdv namespace from the widget tag.

  • Add the Phone Gap namespce to the widget tag: xmlns:gap=""

  • Add the version code to the widget tag: versionCode="1"

  • Update any plugins you have to use the phone gap namespace:

    • for example this:
  • would change to this:
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
  • Now zip up the contents of the www directory. The immediate children of the zip must be the contents of www (not the www folder itself).

  • Upload the zip file to your PhoneGap app page.

  • Download the resulting IPA file.

  • Install on device using GapDebug (a great debugging tool).


@marrobin Could you please give steps to build this ionic2 project With PhoneGap Build. In www folder it had only index.html

@balgaguru the above steps should be performed after you’ve compiled the project locally. The reason your html folder only contains index.html is because you haven’t yet run ‘ionic serve’. Make sure you follow all the steps in the readme file of your project.

would it be possible to create a seperate build command like
ionic phonegap-build
that runs the steps above?

I’ve copied w/o further modifications the cordova config.xml into www and then successfully built the project on phonegap build. According to this source: the gap:plugin is deprecated. I’m using phonegap v6.3.0, ionic 2.0.0-beta.36

Hey, thanks for the tip, I’ve created a gulp task for this