Revision 442843 of Setting up to debug Firefox OS using Firefox Developer Tools

  • Revision slug: Mozilla/Firefox_OS/Debugging/Setting_up
  • Revision title: Setting up to debug on Firefox OS using Firefox developer tools
  • Revision id: 442843
  • Created:
  • Creator: karthikvj
  • Is current revision? No
  • Comment

Revision Content

Firefox OS supports the same remote debugging protocol that Firefox mobile supports on Android. This means you can use the Firefox development tools to debug Gaia applications running on a Firefox OS device or emulator. In order to debug Firefox OS running on your device or on the Firefox OS Simulator, you need to use Firefox 18 or later; in addition, there are settings that need to be changed both in your desktop browser's configuration and on your Firefox OS device or simulator.

Firefox desktop

You need to be sure you have a build of Firefox 18 or later in order to have remote debugging support. If you don't already have a recent copy of Firefox, download the latest stable release of Firefox, or get a more recent Beta, Aurora or Nightly build.

Once you're running an appropriate version of Firefox on your computer, type about:config in the URL bar and change the value of devtools.debugger.remote-enabled to true. Then you'll need to restart Firefox to get remote debugging enabled. After restarting Firefox, the Web Developer menu will have one new option called "Connect...".

Enabling debugging on the Firefox OS Simulator

When using the Firefox OS Simulator (or B2G Desktop), setting up for debugging is pretty easy. You don't need to do any port forwarding like you do when debugging on a physical device. Simply open the Settings app, then Device Information > More Information > Developer. In that menu, enable Remote Debugging.

Now you're ready to use the debugger!

Enabling debugging on a Firefox OS device

Note: This no longer work as of January 10, 2013. As of this date device builds of Firefox OS have debugging disabled. There will eventually be a way to build your own build with it re-enabled, but this doesn't exist yet. This document will be updated once that happens. In addition, the preference for turning off out-of-process support has been removed. For now, you'll need to do your debugging in the Firefox OS Simulator.

On your Firefox OS device, open the Settings app, then Device Information > More Information > Developer. In the developer menu:

  • Turn on Remote Debugging.
  • You also need to turn off out-of-process support, until {{bug(797627)}} is fixed. Without doing so, only system scripts can be debugged.

 

Reminder: If you flash your device, you'll need to redo these configuration changes.

 

Now you're ready to use the debugger!

 

Enabling debugging on a Firefox for Android

Use about:config to enable remote debugging. Set the “devtools.debugger.remote-enabled” pref to true. Restart.

 

Enabling console logging on a Firefox OS device

On production builds of Firefox OS, console logging (such as by {{domxref("console.log()")}}) is disabled by default. In order to enable it, open the Settings app and navigate down through Device Information->More Information->Developer, then toggle on the "Console Enabled" preference.

See also

Revision Source

<p>Firefox OS supports the same remote debugging protocol that Firefox mobile supports on Android. This means you can use the Firefox development tools to debug Gaia applications running on a Firefox OS device or emulator. In order to debug Firefox OS running on your device or on the Firefox OS Simulator, you need to use Firefox 18 or later; in addition, there are settings that need to be changed both in your desktop browser's configuration and on your Firefox OS device or simulator.</p>
<h2 id="Firefox_desktop">Firefox desktop</h2>
<p>You need to be sure you have a build of Firefox 18 or later in order to have remote debugging support. If you don't already have a recent copy of Firefox, download the <a href="http://www.mozilla.org/en-US/firefox/fx/#desktop" title="http://www.mozilla.org/en-US/firefox/fx/#desktop">latest stable release of Firefox</a>, or get a more recent <a href="http://www.mozilla.org/en-US/firefox/channel/" title="http://www.mozilla.org/en-US/firefox/channel/">Beta, Aurora</a> or <a href="http://nightly.mozilla.org/" title="http://nightly.mozilla.org/">Nightly</a> build.</p>
<p>Once you're running an appropriate version of Firefox on your computer, type <code>about:config</code> in the URL bar and change the value of <code>devtools.debugger.remote-enabled</code> to <code>true</code>. Then you'll need to restart Firefox to get remote debugging enabled. After restarting Firefox, the Web Developer menu will have one new option called "Connect...".</p>
<h2 id="Enabling_debugging_on_the_Firefox_OS_Simulator">Enabling debugging on the Firefox OS Simulator</h2>
<p>When using the <a href="/en-US/docs/Tools/Firefox_OS_Simulator" title="Tools/Firefox OS Simulator">Firefox OS Simulator</a> (or B2G Desktop), setting up for debugging is pretty easy. You don't need to do any port forwarding like you do when debugging on a physical device. Simply open the Settings app, then <code>Device Information</code> &gt; <code>More Information</code> &gt; <code>Developer</code>. In that menu, enable Remote Debugging.</p>
<p>Now you're ready to <a href="/en-US/docs/Tools/Debugger" title="/en-US/docs/Tools/Debugger">use the debugger</a>!</p>
<h2 id="Enabling_debugging_on_a_Firefox_OS_device">Enabling debugging on a Firefox OS device</h2>
<div class="warning">
  <p>Note: This no longer work as of January 10, 2013. As of this date device builds of Firefox OS have debugging disabled. There will eventually be a way to build your own build with it re-enabled, but this doesn't exist yet. This document will be updated once that happens. In addition, the preference for turning off out-of-process support has been removed. For now, you'll need to do your debugging in the Firefox OS Simulator.</p>
</div>
<p>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:</p>
<ul>
  <li>Turn on Remote Debugging.</li>
  <li>You also need to turn off out-of-process support, until {{bug(797627)}} is fixed. Without doing so, only system scripts can be debugged.</li>
</ul>
<p>&nbsp;</p>
<div class="note">
  <p><strong>Reminder:</strong> If you flash your device, you'll need to redo these configuration changes.</p>
</div>
<p>&nbsp;</p>
<p>Now you're ready to <a href="/en-US/docs/Tools/Debugger" title="/en-US/docs/Tools/Debugger">use the debugger</a>!</p>
<p>&nbsp;</p>
<h2 id="Enabling_debugging_on_a_Firefox_OS_device">Enabling debugging on a Firefox for Android</h2>
<p>Use <strong>about:config</strong> to enable remote debugging. Set the “<strong>devtools.debugger.remote-enabled</strong>” pref to true. Restart.</p>
<p>&nbsp;</p>
<h2 id="Enabling_console_logging_on_a_Firefox_OS_device">Enabling console logging on a Firefox OS device</h2>
<p>On production builds of Firefox OS, console logging (such as by {{domxref("console.log()")}}) is disabled by default. In order to enable it, open the Settings app and navigate down through Device Information-&gt;More Information-&gt;Developer, then toggle on the "Console Enabled" preference.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/Mozilla/Firefox_OS/Debugging" title="/en-US/docs/Mozilla/Firefox_OS/Debugging">Debugging on Firefox OS</a></li>
  <li><a href="/en-US/docs/Tools/Debugger" title="/en-US/docs/Tools/Debugger">Debugger</a></li>
  <li><a href="/en-US/docs/Mozilla/Firefox_OS/Debugging/Developer_settings" title="/en-US/docs/Mozilla/Firefox_OS/Debugging/Developer_settings">Developer settings on Firefox OS</a></li>
</ul>
Revert to this revision