Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Running B2G and Marionette on an emulator or device

To run B2G with Marionette on an emulator or device, clone the latest B2G code:

 git clone git://github.com/mozilla-b2g/B2G.git

Then run

 export VARIANT=eng

And follow the instructions in the Firefox OS build instructions to make your build.

Using a running emulator / B2G device

If you are already running an emulator or have a running B2G device plugged in, you can run these tests. To do so, you need to forward the port Marionette listens to:

 adb forward tcp:2828 tcp:2828

You can now talk to marionette on port 2828 of localhost.

Debugging the emulator/device

It's a big PITA to debug things on the emulator/device, but you can use log4moz and the Marionette logger to print some statements if you are stuck.

 Cu.import("resource://gre/modules/services-sync/log4moz.js");
 let logger = Log4Moz.repository.getLogger("Marionette");
 logger.info("I'm being logged!");

To view the log, do this, while the instance is running:

 $B2G_HOME/glue/gonk/out/host/linux-x86/bin/adb shell cat /data/b2g/mozilla/<your profile>/marionette.log

Running Marionette on Desktop Firefox or B2G Desktop builds

To run Marionette in Firefox, make sure you have the environment ready for building firefox. Once you're at the stage of configuring and building firefox, you can follow these steps:

Note: For Desktop Firefox ONLY:

Downloading Firefox

Marionette is being bundled with Firefox Desktop in debug builds at the moment on Nightly. You can download them for your OS from our FTP.

You will need to add the following preferences to about:config (right click on the page to create a new entry). The first is a boolean, the second is a string. The -> indicates the mapping of the name to the value

marionette.defaultPrefs.enabled -> true
marionette.defaultPrefs.port -> 2828

Building From Source

Once you have a copy of mozilla-central, you'll need to enable debug builds and add the ENABLE_MARIONETTE flag to your mozconfig:

ac_add_options --enable-debug
ENABLE_MARIONETTE=1

 

Instructions for both Desktop Firefox and B2G Desktop builds:

You may now configure and build:

 make -f client.mk configure
 make -f client.mk build

The Firefox build in your object-directory now has Marionette installed. To enable marionette, you'll need to set some default preferences in your profile. To find the profile directory, use this page. If you're using B2G desktop, replace the /Firefox/ in the path with /B2G/. Go to your profile directory, create the user.js file if necessary, and add the following line:

 user_pref("marionette.defaultPrefs.enabled", true);

Now, when you launch gecko with this profile, then Marionette will be listening on localhost:2828.

Running the Tests with B2G/Gaia

If you're using B2G or the gaia repository, and would like to run the marionette tests associated with the repositories, you have access to a convenience make command that will run the tests on your behalf. Please see the Running Tests page for more information.

Communicating with the Server

You can use our client to talk to the Marionette server. This client is used to run the tests.

Document Tags and Contributors

 Last updated by: fscholz,