Firefox OS

  • Revision slug: Mozilla/Boot_to_Gecko
  • Revision title: Boot to Gecko
  • Revision id: 1471
  • Created:
  • Creator: marshall_law
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

Introduction

'Boot to Gecko' ( also referred to as 'B2G' ) is Mozilla's open source mobile operating system based on Linux and Mozilla's Gecko technology. The idea is essentially to have all user-accessible software running on the phone be a Web app that uses advanced HTML5 techniques and device APIs to access the phone's hardware directly via JavaScript.

For Web developers, the most important part to understand is that the entire user interface is a Web app, one that is capable of displaying and launching other Web apps. Any modifications you make to the user interface and any applications you create to run on B2G are Web pages, albeit with enhanced access to the mobile device's hardware and services.

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
  • more device apis ( not all )
Cons:
  • need to install a C/C++ build system and build gecko
  • The Firefox dev tools are not available.

Project Resources

Setting up & building Boot to Gecko

Developing for Boot to Gecko

Gaia Unit Tests

Marionette for Boot to Gecko

Gaia Unit Tests

Marionette Tutorials

Writing Tests For Marionette

{{ languages( { "pt": "pt/Mozilla/Boot_to_Gecko"} ) }}

Revision Source

<h2>Introduction</h2>
<p>'Boot to Gecko' ( also referred to as 'B2G' ) is Mozilla's open source mobile operating system based on Linux and Mozilla's Gecko technology. The idea is essentially to have all user-accessible software running on the phone be a Web app that uses advanced HTML5 techniques and device APIs to access the phone's hardware directly via JavaScript.</p>
<p>For Web developers, the most important part to understand is that the entire user interface is a Web app, one that is capable of displaying and launching other Web apps. Any modifications you make to the user interface and any applications you create to run on B2G are Web pages, albeit with enhanced access to the mobile device's hardware and services.</p>
<h2>For Web developers</h2>
<p><a class="link-https" href="https://github.com/andreasgal/gaia" title="https://github.com/andreasgal/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 open Web apps 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>
Revert to this revision