Installation
There are a few basic requirements you'll need prior to installing the PhoneGap CLI:
- Node.js - a JavaScript runtime to build your JavaScript code
- git - used in the background by the CLI to download assets. It comes pre-installed on some operating systems. You can check if it's already installed by typing
git
from the command line.
Install via npm
Run the following command to install the latest version of the PhoneGap CLI:
$ npm install -g phonegap
Installing a Specific Version
You can install a specific version of the PhoneGap CLI via npm
by specifying the version number after the @
symbol:
$ npm install -g phonegap@5.1.1
PhoneGap CLI Use Cases
The PhoneGap CLI can be used for different stages of development and with other tools offered by the PhoneGap team. The multiple use cases are outlined below and will determine any other dependencies that may need to be installed.
1 - Paired with the PhoneGap Developer App
Use the PhoneGap CLI to simply create
and serve
your PhoneGap apps for the PhoneGap Developer App to consume as shown in the Getting Started Guides.
2 - Paired with PhoneGap Build
Use the PhoneGap CLI to create and configure your apps locally, then build and package them in the PhoneGap Build cloud service.
3 - Standalone
The PhoneGap CLI can be used to do everything from creating your apps to packaging them for distribution. To build, run and package apps for multiple platforms you'll need to install some additional SDK's and/or tools for the platforms you wish to target. Refer to the Cordova Platform Guides for details on how to proceed for each platform.