Project Links

Meta

Maintainers

Project Description

This is a command line script for the convenience of
developing on B2G such that you need to flash new builds
to your device periodically and begin hacking ASAP.

Features:

Automatically downloads the latest build and flashes it

Configures WiFi on your device

Pre-installs apps that you commonly need

Puts custom prefs on your device

Easy, intuitive command line

You can use a config file for everything

Frictionless convention over configuration

Do you really need this? Probably not!
ezboot is intended for B2G platform developers.
If you are a B2G app developer you should try the
Firefox OS Simulator first because that will have
better features for you (such as Push To Device).

For this script to work you must flash your device with a B2G build that
has Marionette enabled. The flash command will do
that for you. Read this if you want to build various flavors of
B2G with Marionette support yourself.

You’ll try anything at least once, right? The very first time you run
ezboot flash you probably need to enable Remote Debugging first by
digging into
Settings > Device Information > More Information > Developer.
Otherwise, adb won’t be able to connect.
This only applies if you had flashed with a B2G build that did not have
Marionette enabled.
If you’ve never installed B2G at all then you need to enable debugger
connections on Android.

To whet your appetite, here is a full example of ezboot’s intended use.
This documentation
shows you how to make a local config file and use ezboot to quickly prepare a B2G
device for hacking on the Firefox Marketplace payments system.

If you have trouble connecting make sure your mobile device is on the same
network (you probably need WiFi for that) and that your development
server is bound to your public IP.
If it’s a Django app, make sure you start with something like this:

python manage.py runserver 0.0.0.0:8000

because the default, such as:

python manage.py runserver localhost:8000

will not bind to your public IP.

If you have multiple interfaces ezboot bind will show you the possibilities
so you can choose one from the list of options.

Should you want to always use a specific interface then you can use:

ezboot bind --bind_int=...

Alternatively if you want to set a specific IP you can do so like this:

This downloads a fresh desktop B2G build and installs it for use.
Here is a full reference:

ezboot desktop --help

With the default args it will grab the latest B2G18 build.
If you need to install a different build just set the platform
specific URL. For example, if you are on a Mac and you want to get 1.0.1,
set this:

This downloads a device build and saves the Zip file to a custom directory.
The build will not be flashed to a
device and any subsequent reflash command will not attempt to use
it. This is just a convenient way to grab a build without logging in;
the same user/pass options from flash apply here.

Here is a full reference:

ezboot dl --help

You can set a custom location with ezboot dl --location=....
By default it will save builds to ~/Downloads.

This restarts your phone with HTTP logging temporarily enabled.
Here is the full reference:

ezboot http --help

This runs B2G on the device until you interrupt it (^C). After you’re
finished the console will tell you where to find a log of all HTTP
requests/responses. When you view the file it might warn you that it
has binary content but that’s typically just at the beginning of the file.
Keep paging.

Make sure a Persona screen is open on the device then type
ezboot login. Here is a reference:

ezboot login --help

This lets you type the username / password to a new Persona account from
your nice desktop keyboard instead of the device keypad. In a real world
situation this wouldn’t be as annoying since Persona remembers who you are
but for development you’ll be typing new accounts all the time for testing.

This pushes the cert files to your device so that you can install the
Marketplace packaged app (dev version) with elevated privileges and install
signed apps from that Marketplace. You obviously don’t need this if you simply
want to use the production version of Marketplace that is pre-installed on
device.

ezboot mkt_certs --help

Ask someone for a cert file
(see this issue),
download it, and unzip it.
You can install certs for the Marketplace dev packaged app like this:

ezboot mkt_certs --dev --certs_path ~/Downloads/certdb.tmp/

This command requires a device id unless you are using a unagi.
You can configure this like so:

If you’re using an inari or if the device identifier looks like a mac address it
will likely fail. If you have problems, run: adb devices -l and use
the string prefixed with usb: as the flash_device_id. For example:

By convention, if you put a custom prefs file in ./ezboot/custom-prefs.js
where dot is the working directory then it will be pushed to
/data/local/user.js on the device. Any existing custom prefs are not
preserved.

While automated functional tests are fantastic I also want to make sure
developers are testing their changes manually on real devices with the
latest builds. It’s a pain to maintain a development device yourself
so this created an itch that had to be scratched.
There is plenty of prior art on B2G scripts but each had different goals or
they were done with cryptic bash magic.