Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phonegap-build

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phonegap-build

PhoneGap Build command-line interface and node.js library.

  • 0.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
137
decreased by-23.89%
Maintainers
1
Weekly downloads
 
Created
Source

PhoneGap Build CLI Build Status

PhoneGap Build command-line interface and node.js library.

Getting Started on the Command-line (CLI)

CLI: Install

$ sudo npm install -g phonegap-build

CLI: Usage

Usage: phonegap-build [options] [commands]

Synopsis:

  PhoneGap Build command-line environment.

Commands:

  login                login to phonegap build
  logout               logout of phonegap build
  create <path>        create a phonegap project
  build <platform>     build a specific platform
  help [commands]      output usage information

Options:

  -v, --version        output version number
  -h, --help           output usage information

Getting Started with Node.js

Node.js: Install

package.json:

{
    "dependencies": {
        "phonegap-build-cli": "*"
    }
}

Require

var build = require('phonegap-build-cli');

Login

Authenticates with PhoneGap Build, saves the token, and return an API object. When the save token exists, the authentication step is skipped.

Options:

  • options {Object} contains the login credentials.
  • options.username {String} is the username.
  • options.password {String} is the password.
  • [callback] {Function} is called after the login.
    • e {Error} is null on a successful login attempt.
    • api {Object} the API object defined by phonegap-build-rest

Events:

  • error is triggered on an error.
    • e {Error} details the error.
  • complete is trigger when there is no error.
    • api {API} is instance of phonegap-build-api object.

Example:

build.login({ username: 'zelda', password: 'tr1force' }, function(e, api) {
    // pass `api` to other phonegap build commands
});

Logout

Logout the user by deleting the token key from the config file.

Options:

  • args {Object} is unused and should be {}.
  • [callback] {Function} is a callback function.
    • e {Error} is null unless there is an error.

Events:

  • error is trigger on an error.
    • e {Error} details the error.
  • complete is trigger when there is no error.

Example:

build.logout({}, function(e) {
    console.log('now logged out.');
});

Create a New App

Creates an application on the local filesystem and also remotely on PhoneGap Build. The remote application is linked by storing the app ID inside the application's config file.

Options:

  • options {Object} is data required to create an app
    • path {String} is a directory path for the app.
  • [callback] {Function} is triggered after creating the app.
    • e {Error} is null unless there is an error.

Events:

  • error is trigger on an error.
    • e {Error} details the error.
  • complete is trigger when no error occurs.

Example:

build.create({ path: 'path/to/new/app' }, function(e) {
});

Build an App

The build task will compress the application, upload it to PhoneGap Build, and poll until the platform's build status is complete or an error is encountered.

Options:

  • options {Object} is data required for building a platform.
  • options.api {Object} is the phonegap-build-api API object.
  • options.platforms {Array} is a collection of platform names {String} that specify the platforms to build.
  • [callback] {Function} is triggered after the build is complete.
    • e {Error} is null unless there is an error.

Events:

  • error is trigger on an error.
    • e {Error} details the error.
  • complete is trigger when no error occurs.

Example:

build.build({ api: api, platforms: ['android'] }, function(e) {
});

Keywords

FAQs

Package last updated on 22 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc