PhoneGap CLI 用于构建、部署和管理基于PhoneGap的应用(已整合 PhoneGap Build)
PhoneGap CLI要求的环境配置:
- 装有node.js(>=0.10.x),同时会装上npm
- 装有ios-sim,以分发应用到iOS模拟器
安装最新的PhoneGap
$ npm install -g phonegap
PhoneGap CLI用法(phonegap指令)
Usage: phonegap [options] [commands]Description: PhoneGap command-line tool.Commands: createcreate a phonegap project build build a specific platform install install a specific platform run build and install a specific platform local [command] development on local system remote [command] development in cloud with phonegap/build help [command] output usage information version output version numberOptions: -V, --verbose allow verbose output -v, --version output version number -h, --help output usage informationPlatforms: keyword | local environment | remote environment -------------------|-------------------|------------------- android | ✔ | ✔ blackberry | ✔ (BlackBerry 10) | ✔ (BlackBerry 6) ios | ✔ | ✔ symbian | ✖ | ✔ webos | ✖ | ✔ wp7 | ✔ | ✔ wp8 | ✔ | ✖Examples: $ phonegap help create $ phonegap help remote build $ phonegap create path/to/my-app $ phonegap remote build android
可以看出,phonegap另外还有本地用法与云端远程用法两种方式。
本地用法:
Usage: phonegap local [command]Description: Executes the command on the local system. This requires that platform SDK is correctly installed.Commands: buildbuild a specific platform install install a specific platform run build and install a specific platform plugin add, remove, and list pluginsExamples: $ phonegap local build android $ phonegap local run android $ phonegap local plugin list
远程用法:
Usage: phonegap remote [command]Description: Executes the command remotely using the cloud-based PhoneGap/Build service.Commands: login login to PhoneGap/Build logout logout of PhoneGap/Build buildbuild a specific platform install install a specific platform run build and install a specific platformExamples: $ phonegap remote login $ phonegap remote build android $ phonegap remote run android