{"id":13671868,"url":"https://github.com/phonegap/phonegap-cli","last_synced_at":"2025-04-27T18:31:53.049Z","repository":{"id":4940429,"uuid":"6097376","full_name":"phonegap/phonegap-cli","owner":"phonegap","description":"PhoneGap and PhoneGap/Build command-line interface","archived":true,"fork":false,"pushed_at":"2022-04-09T16:44:55.000Z","size":2311,"stargazers_count":491,"open_issues_count":87,"forks_count":153,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-04-24T19:56:47.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phonegap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-05T21:56:47.000Z","updated_at":"2024-10-23T07:23:33.000Z","dependencies_parsed_at":"2022-08-18T02:45:20.653Z","dependency_job_id":null,"html_url":"https://github.com/phonegap/phonegap-cli","commit_stats":null,"previous_names":[],"tags_count":199,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fphonegap-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fphonegap-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fphonegap-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phonegap%2Fphonegap-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phonegap","download_url":"https://codeload.github.com/phonegap/phonegap-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187339,"owners_count":21549620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:01:20.620Z","updated_at":"2025-04-27T18:31:51.626Z","avatar_url":"https://github.com/phonegap.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# PhoneGap CLI \n[![Build Status][travis-ci-img]][travis-ci-url]\u0026nbsp;\n[![Build status](https://ci.appveyor.com/api/projects/status/4yq7ij035ya3g5bq/branch/master?svg=true)](https://ci.appveyor.com/project/stevengill/phonegap-cli/branch/master)\u0026nbsp;[![codecov](https://codecov.io/gh/phonegap/phonegap-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/phonegap/phonegap-cli)\n\n\u003e PhoneGap command-line interface and Node.js library.\n\n## Command-line\n\n### Requirements\n\n- [Install node.js](http://nodejs.org/) version `\u003e=4.0.0`\n- [Install ios-sim](https://github.com/phonegap/ios-sim#installation) to deploy apps to the iOS simulator.\n\n### Install\n\n    $ npm install -g phonegap@latest\n\n### Getting Started\n\n    $ phonegap create my-app    # create a PhoneGap project\n    $ cd my-app                 # change to project directory\n    $ phonegap run ios          # build and install the app to iOS\n\n### Usage\n\n    Usage: phonegap [options] [commands]\n\n    Description:\n\n      PhoneGap command-line tool.\n\n    Commands:\n\n      create \u003cpath\u003e        create a phonegap project\n      build \u003cplatform\u003e     build the project for specific platform\n      install \u003cplatform\u003e   install the project on a specific platform\n      run \u003cplatform\u003e       build and install the projectfor specific platform\n      serve                serve a phonegap project\n      local [command]      development on local system\n      remote [command]     development in cloud with phonegap/build\n      platform [command]   update a platform version\n      help [command]       output usage information\n      version              output version number\n      analytics            turn analytics on or off, or view current status\n\n    Options:\n\n      -d, --verbose        allow verbose output\n      -v, --version        output version number\n      -h, --help           output usage information\n\n    Platforms:\n\n      keyword            | local environment | remote environment\n      -------------------|-------------------|-------------------\n      android            | ✔                 | ✔\n      blackberry10       | ✔                 | ✖\n      ios                | ✔                 | ✔\n      wp8                | ✔                 | ✔\n\n\n    Examples:\n\n      $ phonegap help create\n      $ phonegap help remote build\n      $ phonegap create path/to/my-app\n      $ phonegap remote build android\n\n#### Local Usage\n\n    Usage: phonegap local [command]\n\n    Description:\n\n      Executes the command on the local system.\n\n      This requires that platform SDK is correctly installed.\n\n    Commands:\n\n      build \u003cplatform\u003e     build a specific platform\n      install \u003cplatform\u003e   install a specific platform\n      run \u003cplatform\u003e       build and install a specific platform\n      plugin \u003ccommand\u003e     add, remove, and list plugins\n\n    Examples:\n\n      $ phonegap local build android\n      $ phonegap local run android\n      $ phonegap local plugin list\n\n#### Remote Usage\n\n    Usage: phonegap remote [command]\n\n    Description:\n\n      Executes the command remotely using the cloud-based PhoneGap/Build service.\n\n    Commands:\n\n      login                login to PhoneGap/Build\n      logout               logout of PhoneGap/Build\n      build \u003cplatform\u003e     build a specific platform\n      install \u003cplatform\u003e   install a specific platform\n      run \u003cplatform\u003e       build and install a specific platform\n\n    Examples:\n\n      $ phonegap remote login\n      $ phonegap remote build android\n      $ phonegap remote run android\n\n## Node Library\n\n### Usage\n\n    var phonegap = require('phonegap');\n\n## App Templates\n\nTemplates allow you to create a new app from an existing app template. The\nnice part about templates is that they are simply a Cordova-compatible app.\nAny existing app can be a template.\n\nYou can list the available templates with:\n\n    $ phonegap template list\n\nYou can create a new project from a template with:\n\n    $ phonegap create my-app --template hello-world\n\n### Adding a New Template\n\nAdding a new template is easy.\n\n1. Add your template to the [package.json template section][package-template].\n\n        // the key is your template name (e.g. hello-world)\n        // the url is a HTTP URL to a .tar.gz.\n        {\n          \"templates\": {\n            \"hello-world\": {\n              \"description\": \"Default hello world app for PhoneGap.\",\n              \"url\": \"https://github.com/phonegap/phonegap-app-hello-world/archive/master.tar.gz\"\n            }\n          }\n        }\n\n1. Send us a pull request!\n\n## FAQ\n\n### phonegap: command not found\n\n#### Problem\n\nThe PhoneGap CLI installs successfully but you do not have a command `phonegap`.\n\n#### Reason\n\nDepending on how `node` and `npm` were installed, your globally installed npm\nmodules may not be in your `PATH`.\n\n#### Solution\n\nAt the bottom of your `npm install -g phonegap@latest` installation log, you will see the following:\n\n    ...\n    /usr/local/share/npm/bin/phonegap -\u003e /usr/local/share/npm/lib/node_modules/phonegap/bin/phonegap.js\n    ...\n\n_(Your path may be slightly different)_\n\nOpen `~/.profile` or `~/.bashrc`, depending on what exists on your system, and add following line:\n\n    export PATH=$PATH:/usr/local/share/npm/bin\n\nOpen a new terminal tab or type the following command:\n\n    $ source ~/.profile\n    or\n    $ source ~/.bashrc\n\nThe command `phonegap` should now be available to you.\n\n### The provided path is not an Android project\n\n#### Problem\n\nYou receive the following error message when building an Android project:\n\n    throw new Error('The provided path \"' + project + '\" is not an Android\n\n#### Reason\n\nThe first time that you build for a platform, the framework is downloaded from Apache Cordova.\n\nThe framework is stored locally in your home directory, such as `~/.cordova/lib`.\n\nSometimes the framework is corrupted during the download. It can exist for two\nknow reasons:\n\n1. Your Android SDK environment is not properly configured.\n1. Unknown issue related to Apache's servers or the untar operation.\n\n#### Solution\n\nFirst, you must properly configure your Android environment by following\nthe [platform setup guide](http://docs.phonegap.com/en/3.0.0/guide_platforms_android_index.md.html).\n\nNext, you must delete the cached Cordova Android framework (`x.x.x` is your version):\n\n    ~/.cordova/lib/android/cordova/x.x.x\n\nNext, you can try to rebuild the project. Enabling verbose mode is sometimes helpful:\n\n    $ phonegap build android --verbose\n\n## Upgrading Cordova\n\nThere are a few steps that should be taken when upgrading to a new version of the\n[cordova-cli](http://github.com/apache/cordova-cli).\n\n1. Update the `package.json` dependencies version for `cordova`.\n\n        {\n          \"dependencies\": {\n            \"cordova\": \"3.1.0\"\n          }\n        }\n\n1. Update the `package.json` version.\n\n        {\n          \"version\": \"3.1.0+cordova.0.15.0\"\n        }\n\n1. Run the tests.\n\n        $ npm test\n\n1. Commit stating the version increment.\n\n        $ git add package.json\n        $ git commit -am \"Version 3.1.0+cordova.0.15.0\"\n\n1. Tag the version commit.\n\n        $ git tag 3.1.0+cordova.0.15.0\n\n1. Update the [PhoneGap Hello World App](https://github.com/phonegap/phonegap-app-hello-world) to match the new version.\n  - See [Update instructions](https://github.com/phonegap/phonegap-app-hello-world#updating-the-application).\n  - In the above example, we would update the app to `3.1.0`.\n1. Manually test that the latest Hello World app is lazy-loaded.\n\n        # Link the phonegap-cli for easier development (only need to do once).\n\n        $ cd phonegap-cli/\n        $ [sudo] npm link .\n\n        # Manually test and verify hello world app is lazy-loaded.\n\n        $ phonegap create my-app\n        [phonegap] missing library phonegap/www/3.1.0\n        [phonegap] downloading https://github.com/phonegap/phonegap-app-hello-world/archive/3.1.0.tar.gz...\n        [phonegap] created project at /Users/mwbrooks/Development/sandbox/my-app\n\n        $ cd my-app/\n        $ phonegap run ios\n\n1. Push the git commit after the Hello World has been updated.\n\n        $ git push phonegap master\n\n1. Publish the npm release.\n\n        $ npm publish\n\n## Analytics\n\nPlease read our [privacy policy](http://www.adobe.com/privacy.html) for more information on the\ndata we collect.\n\n[travis-ci-img]: https://travis-ci.org/phonegap/phonegap-cli.svg?branch=master\n[travis-ci-url]: http://travis-ci.org/phonegap/phonegap-cli\n[package-template]: https://github.com/phonegap/phonegap-cli/blob/035057713c613cc0488e4b0beb5b72c4c820d54a/package.json#L67-L76\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphonegap%2Fphonegap-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphonegap%2Fphonegap-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphonegap%2Fphonegap-cli/lists"}