How to set up the Firefox OS desktop build

Revision Information
  • Revision id: 57956
  • Created:
  • Creator: Imen
  • Comment: Added # in line 17
  • Reviewed: Yes
  • Reviewed:
  • Reviewed by: heyjoni
  • Is approved? Yes
  • Is current revision? No
  • Ready for localization: No
Revision Source
Revision Content

Running the Firefox OS Simulator can be very useful for developers, tinkerers, and curious minds wanting to get a feel for how the Firefox OS operates.

Note: The Firefox OS Simulator add-on for Firefox was formerly known as r2d2b2g.

Using the Firefox OS Simulator add-on (recommended)

Running the Firefox OS add-on for the Firefox browser is the quickest and easiest way to get it working in under a minute, and it works on Windows, Mac, and Linux.

Installing the Firefox OS Simulator

Please follow these easy steps to install and run the Firefox OS Simulator add-on for Firefox:

  1. Open your Firefox browser.
  2. Open this link to the Firefox OS Simulator add-on.
  3. Click on the button + Add to Firefox. Firefox will download the requested add-on and ask you to confirm that you want to install it.
  4. Click on the button Install – the add-on will be installed.

Running the Firefox OS Simulator

  1. For Windows 7 and above, at the top of the Firefox window, click on the Firefox button. For Windows XP or Linux go to the Tools menu whereas for Mac, on the menu bar, click on the Tools menu.
  2. Go over to the Web Developer menu, and click Firefox OS Simulator.
  3. On the left side of the simulator window, click on the switch Stopped so that it will turn to Running.

    simulator-fxos
The simulator will start and you may now start playing with Firefox OS!
Tip: Use the home or fn+left arrow buttons on your keyboard to simulate the home button on the device.
Note: For more detailed information, you can read more about Using the Firefox OS Simulator on the Mozilla Developer Network.

If the Firefox OS Simulator add-on does not work for some reason, you may attempt to manually install the simulator following the steps below.

Manually installing the Firefox OS Simulator

Here's how to get Firefox OS running on your desktop computer by manually compiling and installing it. These instructions are based on those by Staś Małolepszy. For more info, see his blog post. For more up-to-date instructions, check the Building and Installing Firefox OS page on the Mozilla Developer Network.

Prepare your computer

If you don't have these things already installed, you'll need to do this before you can get Firefox OS running.

  1. Install XCode from the Mac App store.
  2. Once it's "installed" from the App store, open the app to finish the installation.
  3. Then, open the XCode preferences and install the Command Line Tools.
    Command line tools
  4. Finally, download and install Git from http://git-scm.com/downloads

Get the Boot2Gecko app

  1. Download the latest nightly build from ftp.mozilla.org. You want the latest mac64.dmg file.
  2. Double-click the .dmg file you just downloaded to open it and then drag the B2G.app to your Applications folder.

Get Gaia

  1. First, create a folder to hold everything. For these instructions, we'll create a "FirefoxOS" folder in your Documents folder.
  2. Open up the Terminal application. You automatically start in your Home folder (username:~).
    Terminal home
  3. In the Terminal window, switch to the FirefoxOS folder you created in step 1 by typing, cd Documents/FirefoxOS and then hit return.
    Terminal FirefoxOS
  4. Next, clone the Gaia repository (in English that means, download a copy to your computer) by typing, git clone https://github.com/mozilla-b2g/gaia gaia and then hit return.
    Tip: You can copy and paste commands from this article into your Terminal.
    • A bunch of stuff will happen and you'll see a download progress. When everything is done and you have a prompt again (username:FirefoxOS username$), continue with the next step.
  5. Now you need to create a profile by typing, DEBUG=1 make -C gaia profile and then hit return.
    • Again, a bunch of stuff will happen. When you have a prompt again you'll be done.

Start Firefox OS

  • To start Firefox OS, open the Terminal and type, /Applications/B2G.app/Contents/MacOS/b2g -profile ~/Documents/FirefoxOS/gaia/profile and hit return.
    Note: Use the home or fn+left arrow buttons on your keyboard to simulate the home button on the device.

Update

This desktop version doesn't auto-update. To update it manually:

  1. Download and install the latest nightly build from ftp.mozilla.org.
  2. Open the Terminal, navigate to the gaia folder inside the FirefoxOS folder by typing, cd ~/Documents/FirefoxOS/gaia
  3. Then type, git pull

Get the Boot2Gecko app

  1. Download the Microsoft Visual C++ 2010 SP1 Redistributable Package (x86).
  2. Start the installer and follow the instructions.
  3. Download the pre-built installer for b2g-desktop with pre-compiled gaia.
  4. Start the installer and follow the instructions. Be sure to leave the two checkboxes checked.

Start Firefox OS

Simply click the b2g-gaia-desktop application shortcut from the Windows Start menu to launch Firefox OS.

Note: Use the home button on your keyboard to simulate the home button on the device.

Auto update

This pre-built installer includes an automatic update feature. The second time you launch the app, it will check for updates and ask you if you want to upgrade. Simply click Yes and follow the instructions. The installer will detect your previous install and ask to remove it before upgrading -- say Yes to that too.