Small ruby wrapper for most actions of the PhoneGap Build API, such as creating and building apps and unlocking signing keys
Add this line to your application's Gemfile:
gem 'phonegap_build'
And then execute:
$ bundle
Or install it yourself as:
$ gem install phonegap_build
require 'phonegap_build'
username = '[email protected]'
password = 'my_secret_password'
client = PhonegapBuild::Client.new(username, password)`
puts client.me
There are three important resources which you can manage over the API. The logged in user, his apps, and his signing keys.
The interface tries to mimic ActiveRecord, so most of it should work intuitively.
client.me.to_s
client.apps.all
#=> array of all apps
client.apps.first
#=> first app
client.apps.find(2374624)
#=> find app by id
# create_method file requires you to upload the zipped app
file = File.new('my_app.zip', 'rb')
client.apps.create(title: 'myapp', create_method: 'file', debug: false,
keys: [], file: file)
# create_method remote_repo requires you to provide the repository url
client.apps.create(title: 'myapp', create_method: 'file', debug: false,
keys: [], repo: '[email protected]/Zeilenwerk/phonegapbuild.git')
client.apps.find(2374624).update(debug: true)
client.apps.find(2374624).build
client.apps.find(2374624).build(:android)
client.apps.find(2374624).destroy
client.keys.all
For Android
file = File.new('my_app.keystore', 'rb')
client.keys.create(platform: :android, title: 'myKey', keystore: ks_file,
alias: 'myalias', keystore_pw: 'kspw1234', key_pw: '8rt3372fgta')
or for iOS
profile = File.new('profile.mobileprovision', 'rb')
cert = File.new('cert.p12', 'rb')
client.keys.create(platform: :ios, title: 'myKey', provision: profile,
cert_name: cert, password: 'certificate_password')
For Android
client.keys.find(345453).update(key_pw: 'yxcvb', keystore_pw: 't3887werftgs')
or for iOS
client.keys.find(239784).update(password: 'certificate_password')
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/phonegapbuild-ruby.