Search code examples
firefox-os

How to add a packaged app to Firefox OS destop (desktop B2G)


I'm developing an application for Firefox OS, and need to run Marionette tests (it is needed for my university thesis).

As I know there are two ways of doing this:

  • you have a Marionette enabled device
  • with B2G desktop

I don't have such a device so I tried the B2G desktop. Marionette is working fine, but I couldn’t find any resources that would explain me, how to add my own application to B2G desktop (it would be a packaged app).

Does anyone know how to do this?


Solution

  • There's not an official documentation about how to push an app to Firefox OS Desktop. But you can do it manually at the moment you compile Gaia. Follow the steps from Building the B2G desktop client and at Downloading Gaia step you need to do:

    Download Gaia for the first time, clone the source code repository on GitHub:

    git clone https://github.com/mozilla-b2g/gaia
    cd gaia
    

    Or update an already existing clone of Gaia, you can pull in the latest changes from GitHub:

    cd gaia
    git pull
    

    Now into the directory "apps/" create a new folder with the name of your app and inside of it put the content of your app. You will get a structure like this:

    gaia/
    - apps/
      - homescreen/
      - ...
      - ...
      - my-custom-app/
        - manifest.webapp
        - index.html
        - js/
        - ...
      - keyboard/
      - ...
    - bin/
    - build/
    - ...
    

    Of course, the folder for you custom app in this example is my-custom-app but you can use whatever name that you like.

    Now follow the rest of the steps on the article and you will have your app pulled to the Firefox OS desktop ready to work.

    I am not sure about this step, but I am remember that every time you change something on your app or you add a new app to the gaia/apps/ folder, you need to create the profile again every time you make a change and you like to see it live on the Desktop B2G. So, with this I am sure you can test and let me now if I am right.