Revision Content

Boot to Gecko (B2G) is a new mobile operating system developed as part of the Mozilla project. It uses a Linux kernel and boots into a Gecko-based runtime engine, which lets users run applications developed entirely using HTML, JavaScript, and other open web application APIs.

Related topics

For Web developers

Gaia is the user interface for B2G, and it is a Web application that runs locally on a B2G device, emulator, desktop build, or Firefox build. All you need to know in order to add apps or make changes to Gaia are Web technologies like JavaScript, HTML and CSS.

Boot to Gecko is under heavy development currently; we are constantly working on ways to make it easier for you to use and hack on Gaia and create apps. However, you need knowledge about systems in order to do things like build the entire B2G stack, or flash a phone with a build of B2G. Linked below are guides meant for Web developers interested in running and making changes to Gaia or developing apps to run on Boot to Gecko devices.

Writing apps for Boot to Gecko

B2G apps are nothing more than Open Web apps that are installed on a B2G phone.

If you have a Boot to Gecko developer phone

If you have received a developer phone running B2G from Mozilla or had someone install B2G on your phone, here is a basic guide for working with your phone. We are working to improve this process and hope to have more streamlined instructions on MDN soon. If you are interested in the build/flash process, please see the following section 'Setting up & building Boot to Gecko' for more detailed information.

Running Gaia using Firefox Nightly

If you have some knowledge of git, you can clone the Gaia repository and launch Gaia using a recent Firefox Nightly build.

Pros:

no build system and very little setup required

can use the Firefox dev tools

Cons:

the viewport is based on the size of the browser window

many device-like things won't work

apps are launched in separate, pinned tabs

Firefox Nightly might be unstable

Building and Running B2G desktop builds

It is possible to build a Boot to Gecko 'simulator' and run Gaia using this application. This software is based on Firefox but behaves similar to the on-device experience of Boot to Gecko. Currently Mozilla is working on providing nightly builds of this application for developers, and this work is being tracked in bug 744008. If you are familiar with building the Firefox code-base or C++ projects, you can build this application yourself following these instructions.

Pros:

mobile viewport, similar experience to a mobile device in most respects

Writing Tests For Marionette

Revision Source

<p><strong>Boot to Gecko</strong> (<strong>B2G</strong>) is a new mobile operating system developed as part of the Mozilla project. It uses a Linux kernel and boots into a Gecko-based runtime engine, which lets users run applications developed entirely using <a href="/en/HTML" title="en/HTML">HTML</a>, <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a>, and other open web application APIs.</p>
<nobr>
<table class="topicpage-table"> <tbody> <tr> <td> <h3 name="Documentation">Documentation about Boot to Gecko</h3> <dl> <dt><a href="/en/Mozilla/Boot_to_Gecko/Introduction" title="en/Mozilla/Boot_to_Gecko/Introduction">Introduction to Boot to Gecko</a></dt> <dd>Introductory information about what Boot to Gecko is and how it works.</dd> </dl> <p><span class="alllinks"><a href="/Special:Tags?tag=B2G&amp;language=en" title="Special:Tags?tag=B2G&amp;language=en">View All...</a></span></p> </td> <td> <h3 name="Community">Getting help from the community</h3> <p>If you're working with Boot to Gecko, or developing applications you'd like to run on Boot to Gecko based devices, there are community resources to help you!</p> <ul> <li>Consult the Boot to Gecko forum: {{ DiscussionList("dev-m2g", "mozilla.dev.b2g") }}</li> </ul> <ul> <li>Ask your question on the Mozilla IRC channel: <a class="link-irc" href="irc://irc.mozilla.org/b2g" title="irc://irc.mozilla.org/b2g">#b2g</a></li> </ul> <p><span class="alllinks"><a class="external" href="http://www.catb.org/~esr/faqs/smart-questions.html" title="http://www.catb.org/~esr/faqs/smart-questions.html">Don't forget about the <em>netiquette</em>...</a></span></p> <br> <h3 name="Related_Topics">Related topics</h3> <ul> <li><a href="/en/Mobile" title="en/Mobile">Mobile</a></li> <li><a href="/en/HTML" title="en/HTML">HTML</a></li> <li><a href="/en/CSS" title="en/CSS">CSS</a></li> <li><a href="/en/JavaScript" title="en/JavaScript">JavaScript</a></li> </ul> </td> </tr> </tbody>
</table>
<h2>For Web developers</h2>
<p><a class="link-https" href="https://wiki.mozilla.org/Gaia" title="https://wiki.mozilla.org/Gaia">Gaia</a> is the user interface for B2G, and it is a Web application that runs locally on a B2G device, emulator, desktop build, or Firefox build. All you need to know in order to add apps or make changes to Gaia are Web technologies like JavaScript, HTML and CSS.</p>
<p>Boot to Gecko is under heavy development currently; we are constantly working on ways to make it easier for you to use and hack on Gaia and create apps. However, you need knowledge about systems in order to do things like build the entire B2G stack, or flash a phone with a build of B2G. Linked below are guides meant for Web developers interested in running and making changes to Gaia or developing apps to run on Boot to Gecko devices.</p>
<h4><span class="mw-headline" id="Writing_apps_for_B2G">Writing apps for Boot to Gecko</span></h4>
<p>B2G apps are nothing more than <a href="/en/Apps" title="https://developer.mozilla.org/en/Apps">Open Web apps</a> that are installed on a B2G phone.</p>
<ul> <li><a href="/en/Apps/Getting_Started" title="Getting started with making apps">Getting started with making apps</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Writing_a_web_app_for_B2G" title="Writing a web app">Writing a Web app for B2G</a></li>
</ul>
<h4>If you have a Boot to Gecko developer phone</h4>
<p>If you have received a developer phone running B2G from Mozilla or had someone install B2G on your phone, here is a <a class="link-https" href="https://wiki.mozilla.org/B2G/DeveloperPhone" title="https://wiki.mozilla.org/B2G/DeveloperPhone">basic guide for working with your phone</a>. We are working to improve this process and hope to have more streamlined instructions on MDN soon. If you are interested in the build/flash process, please see the following section 'Setting up &amp; building Boot to Gecko' for more detailed information.</p>
<h4>Running Gaia using Firefox Nightly</h4>
<p>If you have some knowledge of git, you can clone the Gaia repository and launch Gaia using a recent Firefox Nightly build.</p>
<div class="ace-line" id="magicdomid231"><span class="author-g-f6nw4vuclfx20dyp">Pros: </span></div>
<div class="ace-line" id="magicdomid254"> <ul class="list-bullet1"> <li><span class="author-g-f6nw4vuclfx20dyp">no build system and very little setup required</span></li> <li><span class="author-g-f6nw4vuclfx20dyp">can use the Firefox dev tools</span></li> </ul>
</div>
<div class="ace-line" id="magicdomid297"><span class="author-g-f6nw4vuclfx20dyp">Cons:</span></div>
<div class="ace-line" id="magicdomid334"> <ul class="list-bullet1"> <li><span class="author-g-f6nw4vuclfx20dyp">the viewport is based on the size of the browser window</span></li> <li><span class="author-g-f6nw4vuclfx20dyp">many device-like things won't work</span></li> <li><span class="author-g-f6nw4vuclfx20dyp">apps are launched in separate, pinned tabs</span></li> <li><span class="author-g-f6nw4vuclfx20dyp">Firefox Nightly might be unstable</span></li> </ul> <h4>Building and Running B2G desktop builds</h4> <p>It is possible to build a Boot to Gecko 'simulator' and run Gaia using this application. This software is based on Firefox but behaves similar to the on-device experience of Boot to Gecko. Currently Mozilla is working on providing nightly builds of this application for developers, and this work is being tracked in <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=744008" title="https://bugzilla.mozilla.org/show_bug.cgi?id=744008">bug 744008</a>. If you are familiar with building the Firefox code-base or C++ projects, you can build this application yourself <a class="link-https" href="https://wiki.mozilla.org/Gaia/Hacking#Building_B2G" title="https://wiki.mozilla.org/Gaia/Hacking#Building_B2G">following these instructions</a>.</p> <div class="ace-line" id="magicdomid471"><span class="author-g-f6nw4vuclfx20dyp">Pros: </span> <ul class="list-bullet1"> <li><span class="author-g-f6nw4vuclfx20dyp">mobile viewport, similar experience</span> to a mobile device in most respects</li> <li><span class="author-g-f6nw4vuclfx20dyp">more device apis ( not all )</span></li> </ul> </div> <div class="ace-line" id="magicdomid548"><span class="author-g-f6nw4vuclfx20dyp">Cons:</span></div> <div class="ace-line" id="magicdomid613"> <ul class="list-bullet1"> <li><span class="author-g-f6nw4vuclfx20dyp">need to install a C/C++ build system and build Gecko</span></li> <li><span class="author-g-f6nw4vuclfx20dyp">The Firefox dev tools</span> are not available.</li> </ul> </div>
</div>
<h2>Project Resources</h2>
<ul> <li> <a class="link-https" href="https://wiki.mozilla.org/B2G/FAQ" title="B2G/FAQ">Mozilla wiki FAQ</a></li> <li> <a class="link-https" href="https://wiki.mozilla.org/B2G/Schedule_Roadmap" title="https://wiki.mozilla.org/B2G/Schedule_Roadmap">Roadmap</a></li>
</ul>
<h2>Setting up &amp; building Boot to Gecko</h2>
<ul> <li><a href="/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment" title="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment">Setting up B2G Build Environment</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Setting_up_Boot_to_Gecko_Build_Environment_for_Mac_OS_X" title="en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment_for_Mac_OS_X">Setting up B2G Build Environment for Mac OS X</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Building_B2G_for_QEMU_Emulator" title="en/Mozilla/Boot_to_Gecko/Building_B2G_for_QEMU_Emulator">Building B2G for QEMU Emulator</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Galaxy_S2" title="en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Galaxy_S2">Building and flashing B2G for Samsung Galaxy S2</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Nexus_S" title="en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Nexus_S">Building and flashing B2G for Samsung Nexus S</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Updating_an_existing_B2G_phone" title="en/Mozilla/Boot_to_Gecko/Updating an existing B2G phone">Updating an existing B2G phone</a></li>
</ul>
<h2>Developing for Boot to Gecko</h2>
<ul> <li><a href="/en/Mozilla/Boot_to_Gecko/Writing_a_web_app_for_B2G" title="en/Mozilla/Boot_to_Gecko/Writing_a_web_app">Writing a web app</a></li>
</ul>
<h2>Gaia Unit Tests</h2>
<ul> <li><a href="/en/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests" title="Gaia Unit Tests">Running/Writing Unit Tests</a></li>
</ul>
<h2>Marionette for Boot to Gecko</h2>
<ul> <li><a class="link-https" href="https://wiki.mozilla.org/Auto-tools/Projects/Marionette" title="https://wiki.mozilla.org/Auto-tools/Projects/Marionette">The Marionette Test Automation Framework</a></li> <li><a href="/en/Marionette" title="https://developer.mozilla.org/en/Marionette">Marionette on MDN<span style="display: none;"> </span></a></li>
</ul>
<h4>Gaia Unit Tests</h4>
<ul> <li><a href="/en/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests" title="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests">Running/Writing Unit Tests</a></li>
</ul>
<h4>Marionette Tutorials</h4>
<ul> <li><a href="/en/Mozilla/Boot_to_Gecko/Setting_Up_Marionette_for_B2G" title="Building B2G for QEMU Emulator">Setting up Marionette for Boot to Gecko</a></li> <li><a href="/en/Mozilla/Boot_to_Gecko/Marionette_for_Interactive_Python" title="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Marionette_for_Interactive_Python">Marionette for Interactive Python</a></li> <li>Marionette for QEMU emulator</li> <li>Marionette for Samsung Galaxy S2</li>
</ul>
<h4>Writing Tests For Marionette</h4>
<ul> <li><a href="/en/Marionette/Marionette_Python_Tests" title="en/Marionette/Marionette_Python_Tests">Marionette Python Tests</a></li> <li>Marionette JavaScript Tests</li> <li><a href="/en/Marionette/Running_Tests" title="en/Marionette/Running_Tests">Running Marionette Tests</a></li>
</ul>
<p><span class="author-g-h8jtmsk6hxfq7vh9">{{ languages( { "pt": "pt/Mozilla/Boot_to_Gecko"} ) }}</span></p></nobr>