Announcing the prototype Firefox OS Simulator

Firefox OS (and the Boot2Gecko (B2G) project on which it is based) has been written about extensively on Hacks already, but the brief summary is that Mozilla is building a mobile phone operating system where the whole user interface is built on web technology (HTML, CSS and JavaScript). Part of the magic in making that happen is that we’re giving the web platform new superpowers that enable it to access more device capabilities and data sources. Using the web as a basis for apps means that you can build a single app that works on many platforms and with a lot more freedom as a developer.

Getting Started

If you’re thinking “that all sounds great, but how do I get started?”, you can check out Luca Greco’s detailed “Hacking Firefox OS” article. In this article, I’m going to cover some of the specifics of working with the Firefox OS Simulator, which Luca mentions in his article.

The Firefox OS Simulator was introduced in a Hacks post last month as r2d2b2g, a prototype Firefox add-on that makes it really easy to install B2G on your Windows, Mac or Linux computer. B2G is undergoing heavy development, and the Firefox OS Simulator makes it easy to stay up-to-date (the 1.0 release will automatically update… for now, it’s a simple install that doesn’t require restarting Firefox).

We’re angling for a “1.0” release of the Simulator soon. Our main goal with 1.0 is to make it easy to run B2G and install apps that you’re working on into it, and we’re a good way toward that goal right now. You can try out the Simulator right now by downloading it from Myk’s r2d2b2g page.

The Simulator Manager

To get going with the Simulator, you’re first going to open up the “Simulator Manager”. The Manager lets you control the Simulator and manages the apps that you have installed into it. Start up the Manager by selecting “Firefox OS Simulator” from the Web Developer menu, or using the firefoxos manager command from the Developer Toolbar’s command line.

Here’s what the Simulator Manager looks like:

On the left, you’ll find some navigation controls including a switch that lets you start and stop the Simulator. You can also start and stop the Simulator using the firefoxos start and firefoxos stop commands in the Developer Toolbar. The “Console” checkbox allows you to start up with an Error Console window so that you can spot errors that might arise while you’re working on your apps.

Working with your apps

In the screenshot above, you’ll see that I’ve already installed a couple of apps. You can add apps by providing a URL to a site (with autocompletion based on your open tabs) or, even better, a URL to a manifest (so that the app can have a proper icon and such). You’ll need a manifest file anyhow to submit to the Firefox Marketplace, so you might as well start out with that early on.

You can also locate a manifest file on your local computer so that you can create a packaged app (no web server required!).

In the screenshot above, you’ll see that I installed James Long’s Weather Me app straight from GitHub and Fred Wenzel’s Serpent game from a local clone of its git repository. I’ll note that I did have to tweak the manifest for Serpent a little bit, because it was set up to deploy to GitHub rather than from its local directory. Changing just a couple of fields was all it took and then it worked great!

With those set up, I clicked the switch that says “Stopped” to fire up the Simulator. Then, I unlocked it with a swipe of the mouse, and swiped left on the home screen to get to my apps:

As you can see, the Weather Me and Serpent apps are installed and ready for testing! One feature I’d like to point out is the home button at the bottom of the Simulator. You can press the “Home” key on your keyboard to do the same function, but it’s nice having an on-screen button to mimic the physical button a phone would have.

While hacking away on these apps, if I make changes I just have to follow some simple rules to see my changes. Hosted apps follow the usual rules for website caching and for working with appcache (which you should!). You can update packaged apps just by clicking the Update button in the dashboard. The Simulator is updated, restarted and your app is brought into view right away.

Once you’re done working with an app, you can remove it from the manager, which will also remove it from the Simulator (though you made need to restart your Simulator to see the icon disappear).

The Firefox OS Simulator is the easiest way to try out Firefox OS apps today and to verify how they’ll look before submitting them to the Marketplace.

How the Simulator works

The Firefox OS Simulator is different from some mobile environment simulations in that it doesn’t create a virtual computer. Instead, it is actually B2G Desktop, a version of the Boot2Gecko project that is built for desktop operating systems. This allows the Simulator to run very quickly and with minimal startup time on your computer.

Get it today!

Though we’re still cleaning things up for a 1.0 release, you can install it today, give it a try, and let us know if you run into any problems.

About Luca Greco

More articles by Luca Greco…


  1. Bob Pelerson

    “”a prototype Firefox add-on that makes it really easy to install B2G on your Windows, Mac or Linux computer””

    Does it work on FreeBSD as well?

    November 15th, 2012 at 18:14

    1. Kevin Dangoor

      I’m guessing not, because it requires a B2G Desktop build and those are Windows, Mac and Linux only as far as I know.

      November 15th, 2012 at 19:01

      1. Myk Melez

        That’s correct! B2G Desktop, and by extension the Simulator, is only being compiled and built for Windows, Mac, and Linux; so it doesn’t support FreeBSD.

        If you’re a developer, you might be able to get it working on FreeBSD by compiling B2G Desktop on that platform and then configuring the Simulator to use that copy of B2G Desktop, but it might require some hacking of the build configuration at least. It’d probably be easier to try it out in a Linux VM!

        November 16th, 2012 at 10:40

  2. Alexandre

    I have not tested yet but I liked the idea…

    November 16th, 2012 at 04:23

  3. Aaron K.

    Hi all,
    I was just testing the Simulator and i Loved it! :)
    Very buggy though:
    1. The keyboard on Firefox doesn’t go off when pressing enter, it just remains there
    2. The Back button on the menus is very small. ecc.
    Please Mozilla, I’ve been using Firefox since the first day I’ve heard of it, and I’m very pleased… I would like to see a actual device running this smoothly… Please don’t make shitty phone with this, its a Great OS
    Smth with a Dual-core Snapdragon S4 with, 1GB Ram, 4.3″ display would be perfect. If you add support to the main apps like Adobe Pdf , Angry birds, File Manager, Offline Navigation, Skype, Vlc, I’d really consider buying!

    November 16th, 2012 at 05:59

    1. Kevin Dangoor

      Hi Aaron,

      Thanks for the feedback! One thing to keep in mind is that we’re actively working on the first version of Firefox OS. I think it will have a good start and get even better from there.

      November 16th, 2012 at 06:10

      1. Jeffrey

        looks great! I like the application icons very much.If the UI can be more characteristic,there will be more “Wow,Wow,Wow!!!” : )

        November 16th, 2012 at 06:45

  4. Sokratis

    one question:Will an app need internet to work?thanks

    November 16th, 2012 at 06:39

    1. Kevin Dangoor

      No, apps can be made to work entirely offline.

      November 16th, 2012 at 06:41

  5. Ken Saunders

    Excellent breakdown.

    November 16th, 2012 at 08:35

  6. Adam

    Is the windows crash solved?

    November 18th, 2012 at 15:24

    1. Kevin Dangoor

      Yes, the latest version should be working on Windows! Let us know if you run into any trouble.

      November 18th, 2012 at 18:48

  7. Marvin

    Hi Kevin,

    I’m glad you’re making running Firefox OS so easy! I tried to run the emulator before but building it takes a long time and I never got it to work after building.

    So I installed the add-on and ran it but it only shows a blank screen. I’m running Windows 7, I tried the latest normal Firefox and Aurora.

    November 19th, 2012 at 06:26

    1. Alastair

      I have the same issue, except that I’m on OS X on a Macbook Pro. A blank white screen is all that I see when booting up the simulator.

      November 19th, 2012 at 09:05

      1. Kevin Dangoor

        I don’t know what the problem could be here, so I went ahead and opened an issue on GitHub for this problem.

        November 19th, 2012 at 09:14

  8. shimmy

    hi all, im so trilled!! i cant w8 for firefox OS to come out, im not sure will it be installable on other phones, like android ones. but the first thing that firefox users are countin on is privacy and freedom, but not semi freedom and semi privacy like android gives, but the real one…

    been usin fox for about 10 years if im not mistaken, and i still love it

    November 20th, 2012 at 17:37

    1. Kevin Dangoor

      Privacy and freedom are definitely important attributes of the boot2gecko project and Firefox OS.

      People have managed to install Firefox OS on other phones, but it’s definitely not for the faint of heart (and not supported).

      November 20th, 2012 at 19:29

  9. James Parson

    To what extent does the simulator represent a real deployment? Can it be used as the start of a test bench for conducting security research?

    November 22nd, 2012 at 03:21

    1. Kevin Dangoor

      While the underlying OS is different and there could be different characteristics around the hardware (if you’re trying to come up with an attack against the GPU, for example), the bulk of the software stack is going to be the same between the Simulator and a b2g device. I could probably make that statement about Firefox vs. b2g devices as well (since they’re both based on Gecko), but the Simulator is closer still.

      The Simulator does not attempt to reflect different hardware, so if the research you want to do depends on the hardware, then the Simulator is not the tool for you.

      November 26th, 2012 at 09:25

  10. Miguel Angel Ivars Mas

    It’s a great job! Congrats to all the team.

    November 27th, 2012 at 07:15

  11. Jim Cloughley

    Could you tell us what in the manifest you changed in order to get Serpents to work?

    December 2nd, 2012 at 18:56

    1. Kevin Dangoor

      I just changed the paths to not include /serpent/ which is only relevant for GitHub (not for my local server or as a packaged app)

      December 2nd, 2012 at 19:29

  12. Fitoschido

    Why doesn’t the simulator use the Moz fonts?

    December 17th, 2012 at 06:54

    1. Robert Nyman

      I don’t think the branding is necessarily done, but it’s the first steps of testing it. The font might change over time.

      December 18th, 2012 at 01:44

  13. viswaprasath

    So all the apps will require online connection to run. Sometimes it will be bad for under developed or developing countries to use like this I guess so.

    December 23rd, 2012 at 03:52

    1. shimmy

      i hope you are wrong about that, its stupid to make phone which requires internet access all the time..

      December 27th, 2012 at 17:02

  14. M S Rishikesh

    I had a very similar idea months ago applicatios with HTML5. And an OS forvthat. But I got fed up with Assembly and left it. This inspired me a lot. But my OS is for desktop.
    Anyways, I will start making the web apps using emulator. I have an awful lot of ideas for the applications. To-do list manager, Social Media manager to name a few.
    I hope that this will be a success and overtake others. And I will, at any cost, provide quality apps to Firefox OS users.

    Yours Technically,
    M S Rishikesh.

    January 3rd, 2013 at 10:20

  15. Phoenix Fire

    Well, I know I certainly like the idea of this new OS concept, and being open source, this would be great for developers to hop on top of. I know I for one would be interested in seeing what there are for options in the way of websites designed specifically for different operating systems, optimized for each OS. Firefox OS would be an interesting addition to the mix, and, I look forward to trying it out when it’s more stable. If there’s a Virtual machine build available at some point, I would be interested in trying that out as well.

    January 10th, 2013 at 08:57

  16. Janet

    It’s a novel concept, isnt it?

    January 29th, 2013 at 12:51

    1. Robert Nyman [Editor]

      Yes. :-)

      January 30th, 2013 at 02:09

  17. Hardik

    How can I change the resolution as well as the orientation of the simulator? I am using the Firefox OS simulator on windows (as browser add-on, not the desktop client version)..

    April 11th, 2013 at 04:40

Comments are closed for this article.