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: https://build.phonegap.com/
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: https://build.phonegap.com/plans (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:
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.
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 (http://plugins.cordova.io). This includes access to cordova core plugins the minute they are released!”
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: http://docs.build.phonegap.com/en_US/support_getting_help.md.html#Getting%20Help
Any hints or tips for PG developers to consider when using today’s PGB? Put them in the comments.