- {{ _('Firefox OS Simulator') }}
-
-
- {% trans issues='https://github.com/mozilla/r2d2b2g/issues?state=open',
- dev_tools_list='https://lists.mozilla.org/listinfo/dev-developer-tools',
- irc='irc://irc.mozilla.org/#devtools' %}
-
The Firefox OS Simulator is still at an early stage of development,
- and isn't complete or fully reliable.
-
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.
- {% endtrans %}
-
-
-
- {% trans %}
- The Firefox OS Simulator add-on is a tool that enables you to test and
- debug your 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.
- {% endtrans %}
-
- {{ _('Essentially, the Simulator add-on consists of:') }}
-
- {% trans using_b2g='https://developer.mozilla.org/docs/Mozilla/Firefox_OS/Using_the_B2G_desktop_client' %}
- -
- 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.
-
- {% endtrans %}
-
- {{ _('The screenshot below shows a debugging session using the Simulator.') }}
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
- {{ _('This guide covers the following topics:') }}
-
-
- {% trans walkthrough='https://developer.mozilla.org/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough' %}
- For a practical walkthrough that shows how to use the Simulator to
- debug a real web app, see the Simulator
- Walkthrough page.
- {% endtrans %}
-
- {{ _('Installing the Simulator add-on') }}
-
- {% trans %}
- The Simulator is packaged and distributed as a Firefox add-on. To install it:
-
- 1. Using Firefox, go to the appropriate link for your host operating system. You'll probably have to tell Firefox to allow the site to install software:
- {% endtrans %}
-
-
-
- {% trans bug_814505='https://bugzilla.mozilla.org/show_bug.cgi?id=814505' %}
- 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.
- {% endtrans %}
-
-
- {% trans %}
- 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":
- {% endtrans %}
-
-
-
- {% trans %}
- The Dashboard is the tool you use to add your app to the Simulator and run it. Here's
- what it looks like:
- {% endtrans %}
-
-
- {{ _('Adding, updating, and removing apps') }}
- {{ _('Adding apps') }}
-
- {% trans packaged_apps='https://developer.mozilla.org/docs/Apps/Packaged_apps',
- manifests=url('ecosystem.build_manifests') %}
- To add a packaged app to the Simulator, open the
- Dashboard, click "Add Directory" and select the manifest
- file for your app.
- {% endtrans %}
-
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
- {% trans %}
- Unless manifest validation reveals that your app has errors, the Dashboard will then
- automatically run your app in the Simulator.
- {% endtrans %}
-
- {{ _('Managing apps') }}
-
- {% trans %}
- Once you have added an app, it will appear in the Manager's list of installed apps:
- {% endtrans %}
-
-
-
- {% trans %}
- Each entry gives us the following information about the app:
- {% endtrans %}
-
-
- - {{ _('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') }}
-
-
- {% trans %}
- If you've connected a Firefox OS device to your computer, you'll see a fourth command labeled "Push to device".
- {% endtrans %}
-
- {{ _('Manifest validation') }}
-
- {% trans %}
- When you supply a manifest, the Manager will run some validation tests on it. It reports three categories of problems:
- {% endtrans %}
-
-
- - {{ _('manifest errors: problems that will prevent your app from running') }}
- - {{ _('manifest warnings: problems that may prevent your app from working properly') }}
- - {% trans %}simulator-specific warnings: features your app is using that the Simulator doesn't yet support{% endtrans %}
-
-
- {% trans %}
- It summarises the problems encountered in the entry for the app: clicking on the summary provides more details.
- {% endtrans %}
-
- {{ _('Manifest errors') }}
-
- {% trans %}
- 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:
- {% endtrans %}
-
-
- - {{ _('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') }}
-
-
- {% trans %}
- Here's the result of trying to add a manifest file with a missing "name":
- {% endtrans %}
-
-
- {{ _('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:') }}
-
- - {% trans %}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{% endtrans %}
- - {% trans %}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{% endtrans %}
-
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
- {% trans %}
- 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:
- {% endtrans %}
-
-
-
-
-
-
-
- {% trans %}
- You'll see three buttons on the toolbar at the bottom of
- the Simulator window:
- {% endtrans %}
-
-
-
- {% trans %}
- From left to right, these are the Home button, the Rotation Simulation
- button, and the Geolocation Simulation button.
- {% endtrans %}
-
-
- - {{ _('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') }}
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
-
- {% trans %}
- 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.
- {% endtrans %}
-
-
- {% trans %}
- While the Simulator is running another button appears underneath the
- "Console" checkbox. It is labeled "Connect...":
- {% endtrans %}
-
-
- {% trans %}Click it, and you'll be taken to a page that looks like this:{% endtrans %}
-
- {% trans %}Click "Connect" here and you'll see another page, this time like this:{% endtrans %}
-
-
- {% trans debug_toolbar='/docs/Tools/Debugger#The_debugger_toolbar' %}
- 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:
- {% endtrans %}
-
-
- {% trans %}To use the Web Console with your app, select "Main Process" in the "Connect to remote device" window.{% endtrans %}
-
- {% trans %}
- 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".
- {% endtrans %}
-
- {{ _('Push to device') }}
-
- {% trans %}
- 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.
- {% endtrans %}
-
- {{ _('Connecting a device') }}
-
- {% trans adb='http://developer.android.com/tools/help/adb.html' %}
- 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.
- {% endtrans %}
-
-
- -
- {% trans %}
- On your Firefox OS device: open the Settings app, then
Device
- Information
> More Information
> Developer
.
- In the developer menu, check "Remote debugging".
- {% endtrans %}
-
- -
- {% trans android_tools='https://developer.android.com/tools/device.html' %}
- 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
.
- {% endtrans %}
-
-
- {{ _('Pushing apps to the device') }}
-
- {% trans %}
- 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":
- {% endtrans %}
-
-
- {% trans %}Click "Push", and the app will be installed on the Firefox OS device.{% endtrans %}
- {{ _('Limitations of the Simulator') }}
- {% trans %}Note that the Firefox OS Simulator isn't a perfect simulation.{% endtrans %}
- {{ _('Hardware limitations') }}
-
- {% trans %}
- Apart from screen size, the Simulator does not simulate the hardware limitations of a Firefox OS device such as available memory or CPU speed.
- {% endtrans %}
-
- {{ _('Audio/video codecs') }}
- {{ _('The following codecs depend on hardware-accelerated decoding and are therefore not yet supported:') }}
-
- - MP3
- - AAC
- - H.264 (MP4)
- - WebM
-
- {{ _('Unsupported APIs') }}
-
- {% trans %}
- 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:
- {% endtrans %}
-
-
- {{ _('Getting help') }}
-
- {% trans issues='https://github.com/mozilla/r2d2b2g/issues?state=open',
- mailing_list='https://lists.mozilla.org/listinfo/dev-developer-tools',
- irc='irc://irc.mozilla.org/#devtools' %}
- 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.
- {% endtrans %}
-
-