Remote web debugging at mobile devices in Safari and Firefox

21
Mobile remote web debugging Piotr Marcinkiewicz [email protected]

Transcript of Remote web debugging at mobile devices in Safari and Firefox

Page 1: Remote web debugging at mobile devices in Safari and Firefox

Mobile remote web debuggingPiotr Marcinkiewicz [email protected]

Page 2: Remote web debugging at mobile devices in Safari and Firefox

Agenda

Safari debugging in iOS

Firefox debugging in Android

References

Page 3: Remote web debugging at mobile devices in Safari and Firefox

Safari: major steps

Prepare desktop browser

Prepare mobile browser

Connect to device

Debug

Page 4: Remote web debugging at mobile devices in Safari and Firefox

Safari: desktop preparation

Safari contains all modules necessary for development without any downloads.

You should enable “Show Develop menu in menu bar” in your Safari preferences.

Page 5: Remote web debugging at mobile devices in Safari and Firefox

Safari: enable debugging in device

iOS’s Safari includes all modules necessary for remote web debugging

Web debugging can be enabled in Settings/Safari/Advanced/Inspect

Page 6: Remote web debugging at mobile devices in Safari and Firefox

Safari: connect from desktop to device

Connect iOS device to your desktop computer using USB cable.

Select menu Develop/Your device/Your Page

Selected page should be highlighted in your device

Page 7: Remote web debugging at mobile devices in Safari and Firefox

Safari: inspect DOM objects

Browse over DOM structure in your document and inspect objects in device with live highlight

Page 8: Remote web debugging at mobile devices in Safari and Firefox
Page 9: Remote web debugging at mobile devices in Safari and Firefox

Safari: inspect network queries

Use Safari network monitor to observe communication with HTTP server, JavaScript execution, rendering routines

Page 10: Remote web debugging at mobile devices in Safari and Firefox

Safari: execute JavaScript

Execute JavaScript statements with console at target device

Page 11: Remote web debugging at mobile devices in Safari and Firefox
Page 12: Remote web debugging at mobile devices in Safari and Firefox

Firefox: major steps

Prepare mobile browser

Configure debugging bridge

Connect

Debug

Page 13: Remote web debugging at mobile devices in Safari and Firefox

Firefox: prepare mobile browser

Input about:config into address bar in mobile Firefox at Android

Search for: devotees.debugger.remote-enabled

Set configuration value to true

Page 14: Remote web debugging at mobile devices in Safari and Firefox
Page 15: Remote web debugging at mobile devices in Safari and Firefox

Firefox: configure debugging bridge

ADB should be configured to forward ports from device to desktop.

List devices: adb devices

Port forwarding

adb -s device forward tcp:6000 localfilesystem:/data/data/org.mozilla.firefox/firefox-debugger-socket

Page 16: Remote web debugging at mobile devices in Safari and Firefox

Firefox: connect desktop

Enable Remote debugging in Firefox.

Select Connect in Tools menu

Accept connection at device

Page 17: Remote web debugging at mobile devices in Safari and Firefox
Page 18: Remote web debugging at mobile devices in Safari and Firefox

Firefox: debug remote device

Inspect remote DOM document.

Analyse network communication.

Execute JavaScript statements in device.

Page 19: Remote web debugging at mobile devices in Safari and Firefox
Page 20: Remote web debugging at mobile devices in Safari and Firefox
Page 21: Remote web debugging at mobile devices in Safari and Firefox

References

https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Firefox_for_Android

https://developer.android.com/tools/help/adb.html

http://moduscreate.com/enable-remote-web-inspector-in-ios-6/

https://developer.mozilla.org/en-US/docs/Tools/Debugger