PhoneGap CLI (Preview)

Jun 22, 2013

Overview

One of the upcoming features of PhoneGap 3.0 is the command-line interface, which is what has been keeping me busy.

The PhoneGap CLI is open sourced, under active development, and available for you to use today. I would be more than stoked if you gave it a shot, reported an issue, or requested a feature.

A unique feature of the PhoneGap CLI is its ability to compile a project on your local system or PhoneGap Build. Whenever your system is properly configured, it will build the project locally. When something is missing, then it will upload your app to PhoneGap Build. Of course, you can also selectively choose the environment that you want to use.

It's also 100% compatible with Apache Cordova projects and backwards compatible with the cordova-cli.

Install

$ npm install -g phonegap

Usage

Help

$ phonegap
$ phonegap help
$ phonegap --help

Create a project

A quickie:

$ phonegap create path/to/my-app

A custom app name and package ID:

$ phonegap create path/to/my-app --name "My App" --id "ca.michaelbrooks.my-app"

You can always change the application name and ID with www/config.xml.

Build and install the app

$ phonegap run ios

Force a build environment:

$ phonegap local run ios
$ phonegap remote run ios

Acknowledgment

The PhoneGap CLI is an accumulation of effort from the entire Apache Cordova team and many PhoneGap Build team members. However, if you have something to complain about, then I can be your punching bag.