mozilla / r2d2b2g

Firefox OS Simulator is a test environment for Firefox OS. Use it to test your apps in a Firefox OS-like environment that looks and feels like a mobile phone.
https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/
Other
393 stars 139 forks source link

Connect a remote device to Firefox developer tools #414

Open kumar303 opened 11 years ago

kumar303 commented 11 years ago

There's a connect button for the desktop simulator but not for remote devices. It would be nice to connect remote devices because it's not entirely straight forward to hook up devices to developer tools right now: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Using_the_Remote_Web_Console

nickdesaulniers commented 11 years ago

Yeah remote debugging is some busted-ness. If I try using the connect dev tool, it times out. So then I run adb forward tcp:6000 tcp:6000, then try connect again, and I get a prompt on device, and after accepting it, I get a web console window, but it just reports a timeout error after a few seconds of not displaying anything from device. The timeout error looks like Connection timeout. Check the Error Console on both ends for potential error messages. Reopen the Web Console to try again. The only thing I see in logcat is I/GeckoDump( 107): XXX FIXME : Got a mozContentEvent: remote-debugger-prompt. I feel like this is a dev tools issue, not a simulator issue. We plan on slimming down the simulator in the future, before it turns into this.

nickdesaulniers commented 11 years ago

The issue in bugzilla is in the works by @jimblandy

mykmelez commented 11 years ago

I feel like this is a dev tools issue, not a simulator issue.

The Simulator is a devtool, so it can be both! ;-)

We plan on slimming down the simulator in the future, before it turns into this.

Indeed! However, in the short run, the Simulator is the easiest way to install ADB, connect to a device, and push apps to it. So it makes sense to enhance that functionality with the additional ability to easily connect the remote debugging tools so you can debug those apps.

ochameau commented 11 years ago

Until https://bugzilla.mozilla.org/show_bug.cgi?id=797627 is landed in m-c and uplifted to gecko-18, for devices, we can only connect in the system app. (As that's the only app living in the parent process, may be browser app too) Connecting to the system app might be broken as well, but that's something we should be able to fix before bug 797627 is fixed. But do we care about providing access to the system app?? Would it be that bug, happening on master and just being fixed? https://bugzilla.mozilla.org/show_bug.cgi?id=862142

mykmelez commented 11 years ago

I don't think it's valuable to connect to the system app. But in any case I just tested with today's nightly build, and the Connect dialog doesn't show me any available tabs on my Unagi device, just the Main Process. And connecting to it doesn't show any messages in the Web Console nor available scripts in the Debugger. But the fix for bug 862142 landed several days ago. So I don't think that's the reason.

past commented 11 years ago

The console and debugger actors are not present in device builds for security reasons (bug 797627), so remote debugging the main process is pointless IMHO.

kumar303 commented 11 years ago

My understanding is that the remote debugger will be available on device builds but disabled by default. Developers will have to dig into settings to enable them, just like on Android.

ochameau commented 11 years ago

I'm not confident about targeting v4 for that feature. Devtools support on devices is still a work in progress. We should wait for remote debugging to be landed before doing anything serious here. I'd rather try to focus on devtools integration in the simulator against the simulation :) Because I think that we should do that first and also because tools are meant to be working against b2g desktop, and also meant to be not working on device! That's what the code says: http://mxr.mozilla.org/mozilla-central/source/b2g/chrome/content/dbg-browser-actors.js#86

ochameau commented 11 years ago

I submitted a first patch that will allow taking control of webapps actors in order to improve devtools management from the simulator, PR #567. (Like having only one window in Firefox, bypassing the connect page, or opening a toolbox targeting one precise webapps context)