pgbuild contains a library named PhoneGapBuild that lets you manage your phonegap builds at build.phonegap.com without using the website. It also contains a executable called pgbuild that makes you of the PhoneGapBuild library to provide a command line interface.
PhoneGapBuild uses the PhoneGap Build API. It can create, update and delete git based and file based applications. It can also create and delete Android and iOS keys for code signing (other platforms are not supported).
You need to manually create a build.phonegap.com account through the website. pgbuild will prompt you for the username and password on first usage. This information is cached in plain text at $HOME/.pgbuild. Future usages will automatically pick up the username and password from this file.
The output of
pgbuild help is below:
Usage: node pgbuild.js [cmd] [cmd options] Manage apps and download builds from build.phonegap.com. cmd is one of the following: App management create <gitrepo>|<file> - creates an app delete <appid> - deletes app with id appid download <appid> [platform] - download existing build help - shows this help rebuild appid [platforms] - rebuild for specified platforms list - list existing apps buildstatus <appid> - display build status of app update <appid> <gitrepo>|<file>- update existing app. gitrepo requires manual 'rebuild'. Key management createkey android <title> <keystorefile> <keystore pass> <alias> <key pass> - create key createkey ios <title> <p12 certificate> <mobileprovision> <cert pass> deletekey <platform> <id> - delete key listkeys - list all keys setkey <appid> <platform> <keyid> - set key for an app
Creating an app based on a git repo.
$ pgbuild create git://git.forwardbias.in/html5/flyingthings.git Created app with id 238137
Listing existing apps
$ pgbuild list id: 238137 Flying Things 1.0.0 repo: git://git.forwardbias.in/html5/flyingthings.git visibility:private build status: complete: symbian, android, webos, winphone errored: ios pending: blackberry
Downloading a build for an app
$ pgbuild download 238137 android Downloading to /home/girishra/git.forwardbias.in/pgbuild/FlyingThings-debug.apk .......................
Update the app from file contents
$ pgbuild update 238137 ~/git.forwardbias.in/flyingthings.zip
Download the android build
$ pgbuild download 238137 android Downloading to /home/girishra/git.forwardbias.in/pgbuild/FlyingThings-debug.apk ..............
Remove the app
$ pgbuild remove 238137
Read lib/phonegapbuild.js to see the API.
npm install pgbuild. It doesn't have any other
dependencies. It is known to work on Mac, Windows and Linux.
PhoneGapBuild has no built-in support for working with proxies. Currently, the best way to make pgbuild work with proxies (HTTP CONNECT or SOCKS) is to use something like proxychains.