Revision 325203 of Choosing how to run Gaia or B2G

  • Revision slug: Mozilla/Boot_to_Gecko/Choosing_how_to_run_Gaia_or_B2G
  • Revision title: Choosing how to run Gaia or B2G
  • Revision id: 325203
  • Created:
  • Creator: RobinBerjon
  • Is current revision? No
  • Comment

Revision Content

{{ B2GMain() }}

Depending on your specific needs, you have an assortment of options to consider when experimenting with Boot to Gecko or the Gaia user interface. You can choose among the following options; each has its advantages and disadvantages to consider, and some are more flexible than others.

Running Gaia in Firefox

If you know what you're doing, you can clone the Gaia repository and launch Gaia by opening it in Firefox 15 or newer.

Advantages

  • You don't need to build anything, and there's very little setup required.
  • You can use Firefox's built-in developer tools to debug.

Disadvantages

  • The viewport is based on the size of the browser window instead of a device screen size.
  • Many hardware-interface features don't work.
  • Applications are launched in separate, pinned tabs, instead of in the main UI tab.
  • Firefox nightly builds may be unstable, if you're using Nightly.

Why to run Gaia in Firefox

There are two key reasons you might select to run Gaia in Firefox, rather than on hardware or in the simulator; it's very easy to get up and running, and you have access to the excellent developer tools in Firefox. This can be a huge boon to web app developers doing initial testing of the UI and basic functionality of their apps, as well as to Gaia hackers.

Note: Before shipping an app, you will absolutely want to test on real hardware!

Running B2G on the desktop

It's possible to build a Boot to Gecko simulator and run Gaia on it. This software is based on Firefox but behaves very much like the on-device experience of Boot to Gecko. Currently Mozilla provides nightly builds of this application for developers. If you are familiar with building the Firefox code-base or C++ projects, you can build this application yourself following these instructions.

Advantages

  • The simulator provides a mobile-sized viewport.
  • The experience is similar to a real mobile device in most respects.
  • More (but not all) device APIs are available.

Disadvantages

  • You need to actually have a C/C++ build system installed.
  • You need to build Gecko and the simulator yourself.
  • The Firefox developer tools are not available

Why to run the B2G simulator

This is a good middle-of-the-road testing and development solution. It's a good way to get a better feel for how your app or other code will work in a device-like environment without actually having to flash a phone every time you want to test something.

Note: Before shipping an app, you will absolutely want to test on real hardware!

Running B2G on a mobile device

The most thorough way to test your B2G or Gaia development work, or your web app, is to build and install Boot to Gecko on a real mobile device. This is also the most complicated process.

Advantages

  • You get the full mobile device experience.
  • All device APIs are available.
  • You can experience your code's performance in real device usage.

Disadvantages

  • You need a full C/C++ build system installed.
  • You need to build Gecko and Gaia yourself.
  • You need a compatible mobile device on which to install the B2G operating system.
  • You need to flash the device with B2G, removing whatever operating system is currently installed.

Why to run B2G on a mobile device

This is, obviously, the most accurate way to test any code or web project on B2G or Gaia. By running on actual mobile hardware, you can ensure that your project performs well and looks good, and uses all device APIs correctly. In addition, you should always test on real hardware before shipping any code; failing to do so can have unfortunate effects that can be hard to predict.

Revision Source

<p>{{ B2GMain() }}</p>
<p>Depending on your specific needs, you have an assortment of options to consider when experimenting with Boot to Gecko or the <a href="/en/Mozilla/Boot_to_Gecko/Introduction_to_Gaia" title="en/Mozilla/Boot_to_Gecko/Introduction_to_Gaia">Gaia</a> user interface. You can choose among the following options; each has its advantages and disadvantages to consider, and some are more flexible than others.</p>
<h2 id="Running_Gaia_in_Firefox">Running Gaia in Firefox</h2>
<p>If you know what you're doing, you can clone <a class="link-https" href="https://github.com/mozilla-b2g/gaia" title="https://github.com/mozilla-b2g/gaia">the Gaia repository</a> and <a href="/en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox">launch Gaia by opening it in Firefox</a> 15 or newer.</p>
<h3 id="Advantages">Advantages</h3>
<ul>
  <li>You don't need to build anything, and there's very little setup required.</li>
  <li>You can use Firefox's built-in developer tools to debug.</li>
</ul>
<h3 id="Disadvantages">Disadvantages</h3>
<ul>
  <li>The viewport is based on the size of the browser window instead of a device screen size.</li>
  <li>Many hardware-interface features don't work.</li>
  <li>Applications are launched in separate, pinned tabs, instead of in the main UI tab.</li>
  <li>Firefox nightly builds may be unstable, if you're using Nightly.</li>
</ul>
<h3 id="Why_to_run_Gaia_in_Firefox">Why to run Gaia in Firefox</h3>
<p>There are two key reasons you might select to <a href="/en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox" title="en/Mozilla/Boot_to_Gecko/Using_Gaia_in_Firefox">run Gaia in Firefox</a>, rather than on hardware or in the simulator; it's very easy to get up and running, and you have access to the excellent developer tools in Firefox. This can be a huge boon to web app developers doing initial testing of the UI and basic functionality of their apps, as well as to Gaia hackers.</p>
<div class="note">
  <strong>Note:</strong> Before shipping an app, you will absolutely want to test on real hardware!</div>
<h2 id="Running_B2G_on_the_desktop">Running B2G on the desktop</h2>
<p>It's possible to build a Boot to Gecko simulator and run Gaia on it. This software is based on Firefox but behaves very much like the on-device experience of Boot to Gecko. Currently Mozilla provides <a href="https://wiki.mozilla.org/Gaia/Hacking#ATTENTION_-_Desktop_builds_now_available" title="https://wiki.mozilla.org/Gaia/Hacking#ATTENTION_-_Desktop_builds_now_available">nightly builds of this application</a> for developers. 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>
<h3 id="Advantages">Advantages</h3>
<ul>
  <li>The simulator provides a mobile-sized viewport.</li>
  <li>The experience is similar to a real mobile device in most respects.</li>
  <li>More (but not all) device APIs are available.</li>
</ul>
<h3 id="Disadvantages">Disadvantages</h3>
<ul>
  <li>You need to actually have a C/C++ build system installed.</li>
  <li>You need to build Gecko and the simulator yourself.</li>
  <li>The Firefox developer tools are not available</li>
</ul>
<h3 id="Why_to_run_the_B2G_simulator">Why to run the B2G simulator</h3>
<p>This is a good middle-of-the-road testing and development solution. It's a good way to get a better feel for how your app or other code will work in a device-like environment without actually having to flash a phone every time you want to test something.</p>
<div class="note">
  <strong>Note:</strong> Before shipping an app, you will absolutely want to test on real hardware!</div>
<h2 id="Running_B2G_on_a_mobile_device">Running B2G on a mobile device</h2>
<p>The most thorough way to test your B2G or Gaia development work, or your web app, is to build and install Boot to Gecko on a real mobile device. This is also the most complicated process.</p>
<h3 id="Advantages">Advantages</h3>
<ul>
  <li>You get the full mobile device experience.</li>
  <li>All device APIs are available.</li>
  <li>You can experience your code's performance in real device usage.</li>
</ul>
<h3 id="Disadvantages">Disadvantages</h3>
<ul>
  <li>You need a full C/C++ build system installed.</li>
  <li>You need to build Gecko and Gaia yourself.</li>
  <li>You need a compatible mobile device on which to install the B2G operating system.</li>
  <li>You need to flash the device with B2G, removing whatever operating system is currently installed.</li>
</ul>
<h3 id="Why_to_run_B2G_on_a_mobile_device">Why to run B2G on a mobile device</h3>
<p>This is, obviously, the most accurate way to test any code or web project on B2G or Gaia. By running on actual mobile hardware, you can ensure that your project performs well and looks good, and uses all device APIs correctly. In addition, you should <strong>always</strong> test on real hardware before shipping any code; failing to do so can have unfortunate effects that can be hard to predict.</p>
Revert to this revision