Who Is This Book For?

This book is for you, the Cordova or PhoneGap developer who is interested in using the full power of the Cordova CLI, the command line interface for managing Cordova projects.

You know enough about Cordova to have installed at least one device platform toolset. You can build the default application created by running cordova create sampleapp and install it on an emulator.

Almost everything in this book should apply to PhoneGap, because PhoneGap is based on Cordova. In the rare case where it does not, I will note it.

You have installed Cordova CLI using npm by following the instructions, either for Cordova 3.0 or Cordova 2.9.

What Is Covered

The advanced features of Cordova CLI as well as a discussion of how to apply some software techniques, such as deployment environments and version, control to Cordova projects.

Cordova CLI depends on Cordova and has the same version as Cordova. The command line interface was not fully released until Cordova 2.9. I’ll be covering both Cordova CLI 2.9, released in June, 2013, which is the last of the monolithic releases and will be supported for a long time) and Cordova CLI 3.0, released in July, 2013, which is the first of the releases with the new plugin based 3.x architecture. Specifically, all the examples were run with Cordova CLI 2.9.7 and Cordova CLI 3.0.9.

Examples will be for the IOS and Android platforms, as those are the ones I am familiar with (as well as being the most common platforms for development). CLI strives to be platform agnostic, but there may be Cordova CLI nuances for other platforms missed.

This book will follow the creation of a sample Cordova application called sample-cordova-application for the IOS and Android platforms.

Sample Project Directory Layout


 1 sample-cordova-project/
 2    config/
 3      android/
 4        res/
 5      ios/
 6        Resources/
 7    merges/
 8      android/
 9        css/
10      ios/
11        css/
12    platforms/
13      ios/
14         ...
15      android/
16         ...
17    plugins/
18      ios/
19         ...
20      android/
21         ...
22    test/
23    www/
24      js/
25      css/
26      img/

What Is Not Covered

Look elswhere for help in coding the Cordova application (with JavaScript, HTML and CSS). PhoneGap Essentials: Building Cross-Platform Mobile Apps is a fine book about the nuts and bolts of building an Cordova application.

In addition, this is not a basic tutorial of the Cordova CLI tools. The Cordova CLI guide for 3.0 and the guide for 2.9 are both useful. Tutorials like this one are worth reading as well.

This book won’t cover any areas where there is sufficient documentation available, such as writing your own plugin, but will point to helpful resources in passing.