Firefox OS Simulator

  • Revision slug: Tools/Firefox_OS_Simulator
  • Revision title: Firefox OS Simulator
  • Revision id: 388231
  • Created:
  • Creator: Mykmelez1
  • Is current revision? No
  • Comment

Revision Content

The Firefox OS Simulator is still at an early stage of development, and isn't yet as reliable and complete as we'd like it to be.

If you find any bugs, please file them on GitHub, and if you have any questions, try asking on the dev-developer-tools mailing list or on #devtools on irc.mozilla.org.

The Firefox OS Simulator add-on is a tool that enables you to test and debug your Firefox OS app on the desktop. The code-test-debug cycle is much faster with the simulator than with a real device, and of course, you don't need a real device in order to use it.

Essentially, the Simulator add-on consists of:

  • the Simulator: this includes the Firefox OS desktop client, which is a version of the higher layers of Firefox OS that runs on your desktop. The Simulator also includes some additional emulation features that aren't in the standard Firefox OS desktop builds.
  • the Dashboard: a tool hosted by the Firefox browser that enables you to start and stop the Simulator and to install, uninstall, and debug apps running in it. The Dashboard also helps you push apps to a real device, and checks app manifests for common problems.

The screenshot below shows a debugging session using the Simulator.

The Dashboard is on the top-right, running inside a Firefox tab. We've added one app, a packaged app called "Where am I?". At the top-left the app is running in the Simulator. We've also connected the debugging tools, which are in the window at the bottom. You can see that we've just hit a breakpoint in the app.

This guide covers the following topics:

For a practical walkthrough that shows how to use the Simulator to debug a real web app, see the Simulator Walkthrough page.

Installing the Simulator add-on

The Simulator is packaged and distributed as a Firefox add-on. To install it:

  1. Using Firefox, go to the Simulator's page on addons.mozilla.org.
  2. Click "Add to Firefox".
  3. Once the add-on has downloaded you will be prompted to install it: click "Install Now".

Because of the size of the add-on, Firefox may freeze for several seconds while installing it, and a dialog titled "Warning: Unresponsive script" may appear. It it does, click "Continue" to wait for installation to finish. This issue is being tracked as bug 814505.

Once you have installed the Simulator add-on, Firefox will periodically check for newer versions and keep it up to date for you.

The Dashboard opens automatically when you install the Simulator, and you can reopen it at any time by going to the "Firefox" menu (or the "Tools" menu on OS X and Linux), then "Web Developer", then "Firefox OS Simulator":


The Dashboard is the tool you use to add your app to the Simulator and run it. Here's what it looks like:

Adding, updating, and removing apps

Adding apps

To add a packaged app to the Simulator, open the Dashboard, click "Add Directory" and select the manifest file for your app.

To add a hosted app, enter a URL in the textbox where it says "URL for page or manifest.webapp", then click "Add URL". If the URL points to a manifest, then that manifest will be used. If it doesn't, the Dashboard will generate a manifest for the URL: so you can add any website as an app just by entering its URL.

When you add an app, the Dashboard will run a series of tests on your manifest file, checking for common problems. See the section on Manifest Validation for details on what tests are run.

Unless manifest validation reveals that your app has errors, the Dashboard will then automatically run your app in the Simulator.

Managing apps

Once you have added an app, it will appear in the Manager's list of installed apps:

Each entry gives us the following information about the app:

  • its name, taken from the manifest
  • its type, which will be one of "Packaged", "Hosted", or "Generated"
  • a link to its manifest file
  • the result of manifest validation

It also gives us three commands:

  • "Remove": remove the app from the Simulator or the Dashboard. You can undo this action as long as the Dashboard tab is open.
  • "Update": use this to update the app in the Simulator after you have made changes to it. This also makes the Dashboard validate the manifest again. If you make changes to your app they will not be reflected automatically in the installed app: you will need to click "Update", and restart the Simulator if it is running.
  • "Run": run the app in the Simulator

If you've connected a Firefox OS device to your computer, you'll see a fourth command labeled "Push to device".

Manifest validation

When you supply a manifest, the Manager will run some validation tests on it. It reports three categories of problems:

  • manifest errors: problems that will prevent your app from running
  • manifest warnings: problems that may prevent your app from working properly
  • simulator-specific warnings: features your app is using that the Simulator doesn't yet support

It summarises the problems encountered in the entry for the app: clicking on the summary provides more details.

Manifest errors

The Dashboard will report the following conditions as errors, meaning that you won't be able to run your app in the Simulator without fixing them:

  • the manifest does not include the mandatory "name" field
  • the manifest is not valid JSON
  • the app is a hosted app, but the type field in its manifest is "privileged" or "certified", which are only available to packaged apps

Here's the result of trying to add a manifest file with a missing "name":

Manifest warnings

The Dashboard will report the following manifest issues as warnings:

  • missing icons
  • the icon is less than 128 pixels: all apps submitted to the Marketplace must have at least one icon that is at least 128 pixels square
  • the type field is unrecognized
  • the manifest requests a permission that is unrecognized
  • the manifest requests a permission which will be denied
  • the manifest requests a permission for which access could not be determined

Simulator-specific warnings

Finally, the Manager will emit warnings for apps that use features of Firefox OS not yet fully supported by the Simulator:

  • the type field is "certified", but the Simulator does not yet fully supprt certified apps
  • the manifest requests a permission to use an API that is not yet supported by the Simulator

Running the Simulator

There are two different ways the Simulator may be started:

  • if you add, update, or remove an app, or click the "Run" button next to your app's entry, the Dashboard will automatically run your app in the Simulator
  • if you click the button labeled "Stopped" on the left-hand side of the Dashboard, the Simulator will boot to the Home screen and you'll need to navigate to your app

Either way, once the Simulator is running, the button labeled "Stopped" turns green and the label changes to "Running". To stop the Simulator, click this button again.

The Simulator appears as a separate window, sized so the simulated screen area is 320x480 pixels, with a toolbar at the bottom that contains some extra features.

To simulate touch events you can click the mouse button and drag while holding the button down. So by clicking and dragging right-to-left from the Home Screen, you'll see the built-in apps, as well as any apps you have added:

Simulator toolbar

You'll see three buttons on the toolbar at the bottom of the Simulator window:

From left to right, these are the Home button, the Rotation Simulation button, and the Geolocation Simulation button.

  • the Home button takes you to the Home screen
  • the Rotation Simulation button switches the device between portrait and landscape orientation. This will generate the deviceorientation event.
  • the Geolocation Simulation button triggers a dialog asking you to share your geographic location, either using your current coordinates or supplying custom coordinates: this will be made available to your app via the Geolocation API.

Enabling console logging

If you check the "Console" box underneath the "Stopped/Running" switch, then the Error Console will be opened when you run the Simulator. Your app will be able to log to this console using the global console object.

Attaching developer tools

You can attach developer tools to the Simulator, to help debug your app. At the moment you can only attach the JavaScript Debugger and the Web Console, but we're working on adding support for more developer tools.

While the Simulator is running another button appears underneath the "Console" checkbox. It is labeled "Connect...":

Click it, and you'll be taken to a page that looks like this:

Click "Connect" here and you'll see another page, this time like this:

To use the JavaScript Debugger, select "chrome://prosthesis/content/shell.xul" here. Once it's launched, you'll need to find your app's scripts in the script chooser, but if you open your app and then connect the debugger, your app's main script will be selected by default:

To use the Web Console with your app, select "Main Process" in the "Connect to remote device" window.

At the moment, unfortunately, there's no single debugging target that will work with both the Web Console and the JS Debugger - but you can run two simultaneous instances of the debugging tools, one targeting "shell.xul" and the other targeting "Main Process".

Push to device

If you have a Firefox OS device you can connect it to the Simulator, and can then push apps from the Dashboard to the device.

Connecting a device

To connect a device to the Simulator, you need the Android Debug Bridge (adb) to be installed, but the Simulator add-on bundles adb for you. You do, though, need to configure both the Firefox OS device and your desktop OS.

  1. On your Firefox OS device: open the Settings app, then Device Information > More Information > Developer. In the developer menu, check "Remote debugging".
  2. Set up your OS to detect the device. Instructions for this are OS-specific, and are detailed in point 3 of "Setting up a Device for Development" on the Android developer site. The vendor ID to use for Firefox OS Geeksphone devices is 05c6.

Pushing apps to the device

Once you've set up the device and desktop, and connected the device to your desktop via USB, you'll see the note "Device connected." appear on the left of the Dashboard, and a new command appear in the entry for each app labeled "Push":

Click "Push", and the app will be installed on the Firefox OS device.

Limitations of the Simulator

Note that the Firefox OS Simulator isn't a perfect simulation.

Hardware limitations

Apart from screen size, the Simulator does not simulate the hardware limitations of a Firefox OS device such as available memory or CPU speed.

Audio/video codecs

The following codecs depend on hardware-accelerated decoding and are therefore not yet supported:

  • MP3
  • AAC
  • H.264 (MP4)
  • WebM

This means it isn't possible to use the Simulator to test video playback in apps and on websites like Youtube that rely on these codecs.

Unsupported APIs

Certain APIs that work on the device won't work on the Simulator, generally because the supporting hardware is not available on the desktop. We've implemented simulations for some APIs such as geolocation, and expect to add more in future releases. However, at the moment the following APIs are not supported. Using them might throw errors or just return incorrect results:

Getting help

If you find any bugs, please file them on GitHub. If you have a question, try asking us on the dev-developer-tools mailing list or on #devtools on irc.mozilla.org.

Revision Source

<div class="note">
  <p>The Firefox OS Simulator is still at an early stage of development, and isn't yet as reliable and complete as we'd like it to be.</p>
  <p>If you find any bugs, please <a href="https://github.com/mozilla/r2d2b2g/issues?state=open">file them on GitHub</a>, and if you have any questions, try asking on the <a href="https://lists.mozilla.org/listinfo/dev-developer-tools">dev-developer-tools mailing list</a> or on <a href="irc://irc.mozilla.org/#devtools">#devtools on irc.mozilla.org</a>.</p>
</div>
<p>The Firefox OS Simulator add-on is a tool that enables you to test and debug your <a href="/en-US/docs/Apps" title="/en-US/docs/Apps">Firefox OS app</a> on the desktop. The code-test-debug cycle is much faster with the simulator than with a real device, and of course, you don't need a real device in order to use it.</p>
<p>Essentially, the Simulator add-on consists of:</p>
<ul>
  <li><strong>the Simulator</strong>: this includes the <a href="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client" title="/en-US/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client">Firefox OS desktop client</a>, which is a version of the higher layers of <a href="/en-US/docs/Mozilla/Firefox_OS" title="/en-US/docs/Mozilla/Firefox_OS">Firefox OS</a> that runs on your desktop. The Simulator also includes some <a href="#Simulator-toolbar" title="#Simulator-toolbar">additional emulation features</a> that aren't in the standard Firefox OS desktop builds.</li>
  <li><strong>the Dashboard</strong>: a tool hosted by the Firefox browser that enables you to start and stop the Simulator and to install, uninstall, and debug apps running in it. The Dashboard also helps you push apps to a real device, and checks app manifests for common problems.</li>
</ul>
<p>The screenshot below shows a debugging session using the Simulator.</p>
<p>The Dashboard is on the top-right, running inside a Firefox tab. We've added one app, a packaged app called "Where am I?". At the top-left the app is running in the Simulator. We've also connected the debugging tools, which are in the window at the bottom. You can see that we've just hit a breakpoint in the app.</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5139/Simulator-overview.png" /></p>
<p>This guide covers the following topics:</p>
<ul>
  <li><a href="#Installing" title="#Installing">how to install the Simulator add-on</a></li>
  <li><a href="#Adding-updating-removing" title="#Adding-updating-removing">how to add, remove, and update apps</a></li>
  <li><a href="#Manifest-validation" title="#Manifest-validation">manifest validation</a></li>
  <li><a href="#Running-the-Simulator" title="#Running-the-Simulator">how to run the Simulator</a></li>
  <li><a href="#Attaching-developer-tools" title="#Attaching-developer-tools">how to connect developer tools such as the JS debugger to apps running in the Simulator</a></li>
  <li><a href="#Limitations" title="#Limitations">the limitations of the Simulator compared with a real Firefox OS device</a></li>
</ul>
<p>For a practical walkthrough that shows how to use the Simulator to debug a real web app, see the <a href="/en-US/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough" title="/en-US/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough">Simulator Walkthrough</a> page.</p>
<h2 id="Installing_the_Simulator_add-on"><a name="Installing">Installing the Simulator add-on</a></h2>
<p>The Simulator is packaged and distributed as a Firefox add-on. To install it:</p>
<ol>
  <li>Using Firefox, go to <a href="https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/" title="https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/">the Simulator's page on addons.mozilla.org</a>.</li>
  <li>Click "Add to Firefox".</li>
  <li>Once the add-on has downloaded you will be prompted to install it: click "Install Now".</li>
</ol>
<p>Because of the size of the add-on, Firefox may freeze for several seconds while installing it, and a dialog titled "Warning: Unresponsive script" may appear. It it does, click "Continue" to wait for installation to finish. This issue is being tracked as <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=814505" title="https://bugzilla.mozilla.org/show_bug.cgi?id=814505">bug 814505</a>.<br />
  <br />
  Once you have installed the Simulator add-on, Firefox will periodically check for newer versions and keep it up to date for you.</p>
<p>The Dashboard opens automatically when you install the Simulator, and you can reopen it at any time by going to the "Firefox" menu (or the "Tools" menu on OS X and Linux), then "Web Developer", then "Firefox OS Simulator":</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5141/simulator-open-on-windows-7.png" style="width: 453px; height: 533px; display: block; margin-left: auto; margin-right: auto;" /><br />
  The Dashboard is the tool you use to add your app to the Simulator and run it. Here's what it looks like:<br />
  <img alt="" src="https://mdn.mozillademos.org/files/5143/dashboard.png" style="width: 963px; height: 720px;" /></p>
<h2 id="Adding.2C_updating.2C_and_removing_apps"><a name="Adding-updating-removing">Adding, updating, and removing apps</a></h2>
<h3 id="Adding_apps">Adding apps</h3>
<p>To add a <a href="/en-US/docs/Apps/Packaged_apps" title="/en-US/docs/Apps/Packaged_apps">packaged app</a> to the Simulator, open the Dashboard, click "Add Directory" and select the <a href="/en-US/docs/Apps/Manifest" title="/en-US/docs/Apps/Manifest">manifest file</a> for your app.<br />
  <br />
  To add a hosted app, enter a URL in the textbox where it says "URL for page or manifest.webapp", then click "Add URL". If the URL points to a manifest, then that manifest will be used. If it doesn't, the Dashboard will generate a manifest for the URL: so you can add any website as an app just by entering its URL.<br />
  <br />
  When you add an app, the Dashboard will run a series of tests on your manifest file, checking for common problems. See the section on <a href="#Manifest-validation" title="#Manifest-validation">Manifest Validation</a> for details on what tests are run.</p>
<p>Unless manifest validation reveals that your app has errors, the Dashboard will then automatically run your app in the Simulator.</p>
<h3 id="Managing_apps">Managing apps</h3>
<p>Once you have added an app, it will appear in the Manager's list of installed apps:<br />
  <img alt="" src="https://mdn.mozillademos.org/files/5145/dashboard-list-apps.png" /><br />
  Each entry gives us the following information about the app:</p>
<ul>
  <li>its name, taken from the manifest</li>
  <li>its type, which will be one of "Packaged", "Hosted", or "Generated"</li>
  <li>a link to its manifest file</li>
  <li>the result of manifest validation</li>
</ul>
<p>It also gives us three commands:</p>
<ul>
  <li>"Remove": remove the app from the Simulator or the Dashboard. You can undo this action as long as the Dashboard tab is open.</li>
  <li>"Update": use this to update the app in the Simulator after you have made changes to it. This also makes the Dashboard validate the manifest again. If you make changes to your app they will not be reflected automatically in the installed app: you will need to click "Update", and restart the Simulator if it is running.</li>
  <li>"Run": run the app in the Simulator</li>
</ul>
<p>If you've <a href="#Push-to-device" title="#Push-to-device">connected a Firefox OS device</a> to your computer, you'll see a fourth command labeled "Push to device".</p>
<h3 id="Manifest_validation"><a name="Manifest-validation">Manifest validation</a></h3>
<p>When you supply a manifest, the Manager will run some validation tests on it. It reports three categories of problems:</p>
<ul>
  <li>manifest errors: problems that will prevent your app from running</li>
  <li>manifest warnings: problems that may prevent your app from working properly</li>
  <li>simulator-specific warnings: features your app is using that the Simulator doesn't yet support</li>
</ul>
<p>It summarises the problems encountered in the entry for the app: clicking on the summary provides more details.</p>
<h4 id="Manifest_errors">Manifest errors</h4>
<p>The Dashboard will report the following conditions as errors, meaning that you won't be able to run your app in the Simulator without fixing them:</p>
<ul>
  <li>the manifest does not include the mandatory "name" field</li>
  <li>the manifest is not valid JSON</li>
  <li>the app is a hosted app, but the <a href="/en-US/docs/Apps/Manifest#type" title="/en-US/docs/Apps/Manifest#type">type</a> field in its manifest is <a href="/en-US/docs/Apps/Packaged_apps#Types_of_packaged_apps" title="/en-US/docs/Apps/Packaged_apps#Types_of_packaged_apps">"privileged" or "certified"</a>, which are only available to packaged apps</li>
</ul>
<p>Here's the result of trying to add a manifest file with a missing "name":<br />
  <br />
  <img alt="" src="https://mdn.mozillademos.org/files/5147/dashboard-missing-name.png" /></p>
<h4 id="Manifest_warnings">Manifest warnings</h4>
<p>The Dashboard will report the following manifest issues as warnings:</p>
<ul>
  <li>missing icons</li>
  <li>the icon is less than 128 pixels: all apps submitted to the Marketplace must have at least one icon that is at least 128 pixels square</li>
  <li>the <a href="/en-US/docs/Apps/Manifest#type" title="/en-US/docs/Apps/Manifest#type">type</a> field is unrecognized</li>
  <li>the manifest requests a <a href="/en-US/docs/Apps/Manifest#permissions" title="/en-US/docs/Apps/Manifest#permissions">permission</a> that is unrecognized</li>
  <li>the manifest requests a <a href="/en-US/docs/Apps/Manifest#permissions" title="/en-US/docs/Apps/Manifest#permissions">permission</a> which will be denied</li>
  <li>the manifest requests a <a href="/en-US/docs/Apps/Manifest#permissions" title="/en-US/docs/Apps/Manifest#permissions">permission</a> for which access could not be determined</li>
</ul>
<h4 id="Simulator-specific_warnings">Simulator-specific warnings</h4>
<p>Finally, the Manager will emit warnings for apps that use features of Firefox OS not yet fully supported by the Simulator:</p>
<ul>
  <li>the <a href="/en-US/docs/Apps/Manifest#type" title="/en-US/docs/Apps/Manifest#type">type</a> field is "certified", but the Simulator does not yet fully supprt certified apps</li>
  <li>the manifest requests a <a href="/en-US/docs/Apps/Manifest#permissions" title="/en-US/docs/Apps/Manifest#permissions">permission</a> to use an API that is <a href="#Unsupported-APIs" title="#Unsupported-APIs">not yet supported</a> by the Simulator</li>
</ul>
<h2 id="Running_the_Simulator"><a name="Running-the-Simulator">Running the Simulator</a></h2>
<p>There are two different ways the Simulator may be started:</p>
<ul>
  <li>if you add, update, or remove an app, or click the "Run" button next to your app's entry, the Dashboard will automatically run your app in the Simulator</li>
  <li>if you click the button labeled "Stopped" on the left-hand side of the Dashboard, the Simulator will boot to the Home screen and you'll need to navigate to your app</li>
</ul>
<p>Either way, once the Simulator is running, the button labeled "Stopped" turns green and the label changes to "Running". To stop the Simulator, click this button again.<br />
  <br />
  The Simulator appears as a separate window, sized so the simulated screen area is 320x480 pixels, with a <a href="#Simulator-toolbar" title="#Simulator-toolbar">toolbar at the bottom that contains some extra features</a>.</p>
<p>To simulate touch events you can click the mouse button and drag while holding the button down. So by clicking and dragging right-to-left from the Home Screen, you'll see the built-in apps, as well as any apps you have added:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5149/simulator-homescreen.png" style="width: 432px; height: 638px;float:left;" /><img alt="" src="https://mdn.mozillademos.org/files/5151/simulator-apps-screen.png" style="width: 432px; height: 638px;" /></p>
<h3 id="Simulator_toolbar"><a name="Simulator-toolbar">Simulator toolbar</a></h3>
<p>You'll see three buttons on the toolbar at the bottom of the Simulator window:<br />
  <br />
  <img alt="" src="https://mdn.mozillademos.org/files/5159/simulator-toolbar.png" style="width: 415px; height: 190px; margin-left: auto; margin-right: auto; display: block;" />From left to right, these are the Home button, the Rotation Simulation button, and the Geolocation Simulation button.</p>
<ul>
  <li>the Home button takes you to the Home screen</li>
  <li>the Rotation Simulation button switches the device between portrait and landscape orientation. This will generate the <a href="/en-US/docs/WebAPI/Detecting_device_orientation" title="/en-US/docs/WebAPI/Detecting_device_orientation">deviceorientation</a> event.</li>
  <li>the Geolocation Simulation button triggers a dialog asking you to share your geographic location, either using your current coordinates or supplying custom coordinates: this will be made available to your app via the <a href="/en-US/docs/WebAPI/Using_geolocation" title="/en-US/docs/WebAPI/Using_geolocation">Geolocation API</a>.</li>
</ul>
<h3 id="Enabling_console_logging">Enabling console logging</h3>
<p>If you check the "Console" box underneath the "Stopped/Running" switch, then the <a href="/en-US/docs/Error_Console" title="/en-US/docs/Error_Console">Error Console</a> will be opened when you run the Simulator. Your app will be able to log to this console using the global <a href="/en-US/docs/DOM/console" title="/en-US/docs/DOM/console">console</a> object.</p>
<h3 id="Attaching_developer_tools"><a name="Attaching-developer-tools">Attaching developer tools</a></h3>
<p>You can attach developer tools to the Simulator, to help debug your app. At the moment you can only attach the <a href="/en-US/docs/Tools/Debugger" title="/en-US/docs/Tools/Debugger">JavaScript Debugger</a> and the <a href="/en-US/docs/Tools/Web_Console" title="/en-US/docs/Tools/Web_Console">Web Console</a>, but we're working on adding support for more developer tools.</p>
<p>While the Simulator is running another button appears underneath the "Console" checkbox. It is labeled "Connect...":</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5167/dashboard-connect.png" style="width: 459px; height: 442px; margin-left: auto; margin-right: auto; display: block;" /></p>
<p>Click it, and you'll be taken to a page that looks like this:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5163/connect-port-selection.png" style="width: 798px; height: 718px; margin-left: auto; margin-right: auto; display: block;" />Click "Connect" here and you'll see another page, this time like this:<br />
  <br />
  <img alt="" src="https://mdn.mozillademos.org/files/5165/connect-target-selection.png" style="width: 798px; height: 718px; margin-left: auto; margin-right: auto; display: block;" /></p>
<p>To use the <a href="/en-US/docs/Tools/Debugger" title="/en-US/docs/Tools/Debugger">JavaScript Debugger</a>, select "chrome://prosthesis/content/shell.xul" here. Once it's launched, you'll need to find your app's scripts in the <a href="/en-US/docs/Tools/Debugger#The_debugger_toolbar" title="/en-US/docs/Tools/Debugger#The_debugger_toolbar">script chooser</a>, but if you open your app and then connect the debugger, your app's main script will be selected by default:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5169/js-debugger.png" style="width: 971px; height: 400px; margin-left: auto; margin-right: auto; display: block;" /> To use the <a href="/en-US/docs/Tools/Web_Console" title="/en-US/docs/Tools/Web_Console">Web Console</a> with your app, select "Main Process" in the "Connect to remote device" window.</p>
<p>At the moment, unfortunately, there's no single debugging target that will work with both the Web Console and the JS Debugger - but you can run two simultaneous instances of the debugging tools, one targeting "shell.xul" and the other targeting "Main Process".</p>
<h2 id="Push_to_device"><a name="Push-to-device">Push to device</a></h2>
<p>If you have a Firefox OS device you can connect it to the Simulator, and can then push apps from the Dashboard to the device.</p>
<h3 id="Connecting_a_device">Connecting a device</h3>
<p>To connect a device to the Simulator, you need the <a href="http://developer.android.com/tools/help/adb.html" title="http://developer.android.com/tools/help/adb.html">Android Debug Bridge (adb)</a> to be installed, but the Simulator add-on bundles adb for you. You do, though, need to configure both the Firefox OS device and your desktop OS.</p>
<ol>
  <li>On your Firefox OS device: open the Settings app, then <code>Device Information</code> &gt; <code>More Information</code> &gt; <code>Developer</code>. In the developer menu, check "Remote debugging".</li>
  <li>Set up your OS to detect the device. Instructions for this are OS-specific, and are detailed in point 3 of <a href="https://developer.android.com/tools/device.html" title="https://developer.android.com/tools/device.html">"Setting up a Device for Development"</a> on the Android developer site. The vendor ID to use for Firefox OS Geeksphone devices is <code>05c6.</code></li>
</ol>
<h3 id="Pushing_apps_to_the_device">Pushing apps to the device</h3>
<p>Once you've set up the device and desktop, and connected the device to your desktop via USB, you'll see the note "Device connected." appear on the left of the Dashboard, and a new command appear in the entry for each app labeled "Push":</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/5227/device-connected.png" /></p>
<p>Click "Push", and the app will be installed on the Firefox OS device.</p>
<h2 id="Limitations_of_the_Simulator"><a name="Limitations">Limitations of the Simulator</a></h2>
<p>Note that the Firefox OS Simulator isn't a perfect simulation.</p>
<h3 id="Hardware_limitations">Hardware limitations</h3>
<p>Apart from screen size, the Simulator does not simulate the hardware limitations of a Firefox OS device such as available memory or CPU speed.</p>
<h3 id="Audio.2Fvideo_codecs">Audio/video codecs</h3>
<p>The following codecs depend on hardware-accelerated decoding and are therefore not yet supported:</p>
<ul>
  <li>MP3</li>
  <li>AAC</li>
  <li>H.264 (MP4)</li>
  <li>WebM</li>
</ul>
<p>This means it isn't possible to use the Simulator to test video playback in apps and on websites like Youtube that rely on these codecs.</p>
<h3 id="Unsupported_APIs"><a name="Unsupported-APIs">Unsupported APIs</a></h3>
<p>Certain APIs that work on the device won't work on the Simulator, generally because the supporting hardware is not available on the desktop. We've implemented simulations for some APIs such as geolocation, and expect to add more in future releases. However, at the moment the following APIs are not supported. Using them might throw errors or just return incorrect results:</p>
<ul>
  <li><a href="/en-US/WebAPI/WebTelephony" title="/en-US/WebAPI/WebTelephony">Telephony</a></li>
  <li><a href="/en-US/docs/WebAPI/WebSMS" title="/en-US/docs/WebAPI/WebSMS">WebSMS</a></li>
  <li><a href="/en-US/docs/WebAPI/WebBluetooth" title="/en-US/docs/WebAPI/WebBluetooth">WebBluetooth</a></li>
  <li><a href="/en-US/docs/WebAPI/Using_Light_Events" title="/en-US/docs/WebAPI/Using_Light_Events">Ambient Light</a></li>
  <li><a href="/en-US/docs/WebAPI/Proximity" title="/en-US/docs/WebAPI/Proximity">Proximity</a></li>
  <li><a href="/en-US/docs/WebAPI/Network_Information" title="/en-US/docs/WebAPI/Network_Information">Network Information</a></li>
  <li><a href="/en-US/docs/Online_and_offline_events" title="/en-US/docs/Online_and_offline_events">navigator.onLine and offline events</a></li>
  <li><a href="/en-US/docs/WebAPI/Vibration" title="/en-US/docs/WebAPI/Vibration">Vibration</a></li>
</ul>
<h2 id="Getting_help">Getting help</h2>
<p>If you find any bugs, please <a href="https://github.com/mozilla/r2d2b2g/issues?state=open">file them on GitHub</a>. If you have a question, try asking us on the <a href="https://lists.mozilla.org/listinfo/dev-developer-tools">dev-developer-tools mailing list</a> or on <a href="irc://irc.mozilla.org/#devtools">#devtools on irc.mozilla.org</a>.</p>
Revert to this revision