Boot to Gecko aims to create a complete, standalone operating system for the open web.
Pull request Compare This branch is 645 commits behind mozilla-b2g:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Boot to Gecko (B2G)

Boot to Gecko aims to create a complete, standalone operating system for the open web.

You can read more about B2G here:

follow us on twitter: @Boot2Gecko

join the Mozilla Platform mailing list:

and talk to us on IRC:

#B2G on





Run to get a list of supported devices:


And then run for the device you want to build for:

./ [device name]

Udev Permissions

If you get "error: insufficient permissions for device"...

Obtain ID of device manufacturer (first 4 hexidecimal digits before colon):

$ lsusb

Add a line to /etc/udev/rules.d/android.rules (replacing XXXX with 4 digit ID):

SUBSYSTEM=="usb", ATTRS{idVendor}=="XXXX", MODE="0666"

Restart udev before re-plugging your device for it to be detected:

$ sudo service udev restart

Re-run configure:

./ [device name]

Building against a custom Gecko

It can sometimes be useful to build against a different Gecko than the one specified in the manifest, e.g. a mozilla-central checkout that has some patches applied. To do so, edit .userconfig:



Run or to build B2G.


If you want to just build gecko or some other project, just specify it:

./ gecko


Make sure your phone is plugged in with usb debugging enabled.

To flash everything on your phone:


To flash system/userdata/boot partitions on fastboot phones:

./ system
./ boot
./ user

To update gecko:

./ gecko

To update gaia:

./ gaia

Update Repos

To update all repos:

git pull
./repo sync

To update a specific repo (eg, gaia):

./repo sync gaia


To restart B2G and run B2G under gdb:


To attach gdb to a running B2G process:

./ attach


To run the Marionette test suite on the emulator:


To run specific tests (individual files, directories, or ini files):

./ gecko/dom/sms gecko/dom/battery/test/marionette/

Specify the full path if you're using a different Gecko repo:

./ /path/to/mozilla-central/dom/battery/test/marionette/