Notes About Using PhoneGap Build

This is not a tutorial, but a list of things a Cordova PhoneGap developer needs to know if he or she wants to start using PhoneGap Build (PGB). PGB will take your www/ assets and create the files needed for iOS, Android, and Windows devices. It doesn’t use native files, such as those ending in .h, .m, .java, etc.; the build may fail if these are included. What follows are the notes I took as I considered whether to use the service. Read this as a FAQ page for preparing an app for PGB. Curious as to whether PhoneGap Build is for you? Read on…

Main site: 

If building for iOS, one needs a Mac with Xcode installed to convert the iPhone developer certificate to a P12 file. Of course, one needs a developer account at Apple to create the developer certificate.

You don’t need to download the individual platform software development kits (SDKs), such as ADT+Eclipse for Android; however, you’ll want to use them to debug your programs in their emulators if you don’t have devices at hand for testing.

PhoneGap Build supports a maximum project size of 15MB. If you have a paid Creative Cloud account or a monthly paid subscription then the maximum project size is 40MB. These limits will be a deal-breaker for many. (They limit it to 40MB to allow for plugins and framework overhead.) 12/10/2014 update: The new limits are 50MB for free tier users, 100MB for standalone users and 1GB for Creative Cloud subscribers.

PGB is free to use for one “private” Github repo, or for any number of “public” Github repos. Pricing start with more than 1 private app: (Not sure I am understanding the “25” correctly as a limit of apps on the linked Plans page.)

If you’ve been using PhoneGap already, then these are extra things to pay attention to:

*    *    *

1. You’ll need to format your phonegap.js or cordova.js script tag like this:
<script src=”phonegap.js”></script>
<script src=”cordova.js”></script>

2. When you’ve finished with checking your project and are ready to submit it to PGB, you’ll need to remove the cordova.js or phonegap.js file you’ve been using, as Build will automatically inject it during compile time, changing it for each platform as necessary. You’ll keep the script tags in place in your index.html page, though.

3. At the time of this writing, Cordova has just released v3.4.0, and PGB supports from 3.0 to 3.4 (according to the PGB blog). Apps for 2.9.0 will need to be updated to the CLI version.

4. PGB uses its own version of Cordova plugins. The plugins may not work across all platforms. It’s up to the developer to test each one. Each plugin needs to be imported, the <gap:plugin> code for each needs to be added to config.xml, and JavaScript code needs to be added to the pages where the plugin is used. (Script links to any plugin’s JavaScript files should be present in your HTML files, but the JavaScript files themselves must be removed from your app before uploading to build. The files are present only for debugging/testing, then removed before upload to PGB.)

12/10/2014 update: “In addition to the over 600 plugins currently available on PhoneGap Build we are now allowing users to use plugins from the Official Cordova Plugin Repository ( This includes access to cordova core plugins the minute they are released!”

Plugins repository:

5. You’ll add much more information to the config.xml file than usual. You’ll need to read each of these pages to make sure nothing is missing:

6. The config.xml and index.html files must be in the root of the project folder. (The config.xml file is already at the root in a PG/Cordova project.) Not sure whether the index.html file can reside in both places.

7. You’ll create a folder for icons and splashscreens and place a special, empty .pgbomit file in it. The “omit” file will help make sure the correct image files are present in each platform. We don’t want iOS splashscreens and icons in our Android platform! Instructions:

8. For Android, one must generate a signing key/keystore via the command-line interface in Terminal. (It’s the same information you use when creating a signing key in Eclipse.) When the app is submitted to PGB, that keystore number must be submitted with it. The steps are here:

*    *    *

PGB has identified many common problems with uploads. Read this page carefully to catch them before uploading to PGB:

PGB doesn’t test your code for correctness. You’ll need to do all your HTML, CSS, and JS validation and debugging, minifying your JS files, compressing your graphics, removing debug console.log code and alerts, and so on, before submitting your work.

To use the Adobe PhoneGap Build service after your app files are complete, you must first sign in with your Adobe ID or Github account or register. At that point the service is ready to receive your project either as a Github repository or a .zip file. (No need to sign in or register until your project is ready to upload.)

Some of the PGB docs are out of date. (For instance, one doc says PGB accepts up to PhoneGap v3.1.0, when it now accepts v3.4.0.) To stay up to date, subscribe to their blog and Twitter feeds. The Twitter feed will let you know about plugin updates and other news.
Other support:

Any hints or tips for PG developers to consider when using today’s PGB? Put them in the comments.

One thought on “Notes About Using PhoneGap Build

  1. Pingback: Setting Up Your Developmemt Environment for Cordova/PhoneGap Android projects | iPhone Dev Log

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s