FireFox调试手机浏览器
https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Firefox_for_Android
This guide explains how to use remote debuggingto inspect or debug code running inFirefox for Androidover USB.
This guide's split into two parts: the first part, "Prerequisites" covers stuff you only need to do once, while the second part, "Connecting", covers stuff you need to do each time you connect the device.
Prerequisites
First, you'll need:
- a desktop or laptop computer with Firefox running on it
- an Android device capable of running Firefox for Android with Firefox for Android running on it
- a USB cable to connect the two devices
ADB setup
Next, you'll need to get the desktop and the Android device talking to each other using the adb command-line tool.
On the Android device
- Enable USB debugging (step 2 of this link only).
- Attach the device to the desktop via USB.
On the desktop
- Install the correct version of the Android SDK for your device.
- Using the Android SDK, install the Android Platform Tools.
- Android Platform Tools installs adb in the "platform-tools" directory under the directory in which you installed the Android SDK. Make sure the "platform-tools" directory is in your path.
To check it worked, open up a command shell on the desktop and type:
adb devices
You should see some output like:
List of devices attached
51800F220F01564 device
(The long hex string will be different.)
If you do, then adb
has found your device and you've successfully set up ADB.
Enable remote debugging
Next, you need to enable remote debugging on both the Android device and the desktop.
Firefox for Android 24 and earlier
To enable remote debugging on the device, you need to set thedevtools.debugger.remote-enabled
preference to true
.
Go to about:config
in Firefox for Android, type "devtools" into the search box and press the Search key. You'll see all the devtools preferences. Find thedevtools.debugger.remote-enabled
preference, and press "Toggle".
Firefox for Android 25 and later
On Firefox for Android 25 and later, there's a menu item to enable remote debugging. Open the menu, select "Settings", then "Developer tools" (on some Android devices you may need to select "More" to see the "Settings" option). Check the "Remote debugging" box:
The browser will display a notification reminding you to set up port forwarding, which we'll do later on.
On the desktop
On the desktop, remote debugging is enabled by a setting in the Toolbox. Open the Toolbox, click the "Settings" button in the toolbar, and check "Enable remote debugging" in the Settingstab:
You'll then see a new option in the Web Developer menu labeled "Connect...":
Connecting
Now you can connect the remote debugging tools to the device. First, attach the device to the desktop with a USB cable, if you haven't already.
On the desktop
Go to a command prompt, and type:
adb forward tcp:6000 tcp:6000
(If you've changed the value the Android device uses for a debugging port, you'll need to adjust this accordingly.)
For Firefox OS, type:
adb forward tcp:6000 localfilesystem:/data/local/debugger-socket
You'll need to reissue this command each time you physically attach desktop and device with the USB cable.
Then go to the Web Developer menu on Firefox, and select "Connect...". You'll see a page that looks like this:
Unless you've changed the port numbers, choose 6000 and press the "Connect" button.
On the Android device
Next you'll see a dialog on the Android device asking you to confirm the connection:
Press "OK". The desktop waits for a few seconds to give you time to acknowledge this dialog: if it times out, just press "Connect" in the desktop dialog again.
On the desktop
Next, the desktop shows you a dialog that looks something like this:
This is asking whether you want to debug web content running in a browser tab, or to debug the browser code itself.
- You'll see one entry under "Available remote tabs" for each open tab, and clicking it will attach the debugging tools to the web content hosted by that tab. If you want to debug your web content, you'll choose the relevant content tab.
- You'll see one entry under "Available remote processes": this is the browser process itself. You'll choose this option if you want to debug the browser's own code.
Let's choose to attach to the mozilla.org website. The Toolbox will open in its own window, attached to the Firefox for Android tab that's currently hosting mozilla.org:
The Toolbox, and the tools it hosts, work in just the same way as they do when attached to local content.
Attachments
File | Size | Date | Attached by |
---|---|---|---|
remote-debugger-about-config-toggle
|
95831 bytes | 2013-08-01 15:36:19 | wbamberg |
remote-debugging-connect-menuitem
|
81023 bytes | 2013-08-01 17:15:16 | wbamberg |
remote-debugging-deskopt-connect
|
85186 bytes | 2013-08-01 17:20:07 | wbamberg |
remote-debugging-device-connect
|
167472 bytes | 2013-08-01 17:26:11 | wbamberg |
remote-debugging-deskopt-select-target
|
90358 bytes | 2013-08-01 19:41:30 | wbamberg |
remote-debugging-console
|
124892 bytes | 2013-08-01 20:35:29 | wbamberg |
remote-debugging-debugger
|
266637 bytes | 2013-08-01 20:35:45 | wbamberg |
remote-debugger-toolbox-settings
|
123586 bytes | 2013-08-01 23:09:18 | wbamberg |
remote-debugging-device-enable
|
45182 bytes | 2013-08-02 09:37:26 | wbamberg |
remote-debugging-overview
|
394293 bytes | 2013-08-02 12:25:02 | wbamberg |
FireFox调试手机浏览器的更多相关文章
- web端 调试 手机混合应用中的h5部分(chrome浏览器的devtool使用)
Learning Hybird App Test–Appium Java(Leyden) 浏览器的远程调试工具,使得我们可以通过PC上开启的控制台,调试手机浏览器中正在运行的代码.运行于 Androi ...
- UC浏览器开发者版调试手机页面
1 关于RI 目前,在手机上使用浏览器访问网页,无法便捷地进行网页语言调试.手机屏幕相对较小且操作不便,直接在手机上进行网页数据调试不太现实. 因此,我们使用技术将手机网页调试信息分离,实现一种能在大 ...
- 通过chrome浏览器调试手机页面(IOS和Android)
开发PC页面的时候使用chrome浏览器的开发者工具,可以很容易的捕获到页面的dom元素,并且可以修改样式,方便调试,但是手机上却很麻烦,因为手机上没有办法直接打开开发者工具查看元素.其实可以通过将设 ...
- Fiddler4工具配置及调试手机和PC端浏览器
Fiddler最大的用处: 模拟请求.修改请求.手机应用调试 Fiddler最新版本 下载地址: http://www.telerik.com/download/fiddler Fiddler 想要监 ...
- 在PC机上,如何用Chrome浏览器模拟查看和调试手机的HTML5页面?
如题,如何用PC机上的Chrome浏览器模拟查看和调试手机HTML5页面? 参考操作步骤如下: 第一步.用Chrome打开要调试的页面: 第二步.按F12,打开“开发者工具”,点击其右上角的“Dock ...
- 在PC上测试移动端网站和模拟手机浏览器的5大方
查了很多资料,尝试了大部分方法,下面将这一天的努力总结下分享给大家,也让大家免去看那么多文章,以下介绍的方法,都是本人亲自测试成功的方法,测试环境winxp. 一.Chrome*浏览器 chrome模 ...
- 在PC上测试移动端网站和模拟手机浏览器的5大方法
在PC上测试移动端网站和模拟手机浏览器的5大方法 来源:互联网 作者:佚名 时间:03-19 10:14:54 [大 中 小] 最近公司要开发网站的移动版,让我准备准备知 ...
- Opera浏览器测试移动端网站和模拟手机浏览器的方法
链接地址:http://www.neirong.org/post-256.html?utm_source=tuicool Chrome浏览器请看:Chrome浏览器测试移动端网站和模拟手机浏览器的方法 ...
- 【转】在PC上测试移动端网站和模拟手机浏览器的5大方法
查了很多资料,尝试了大部分方法,下面将这一天的努力总结下分享给大家,也让大家免去看那么多文章,以下介绍的方法,都是本人亲自测试成功的方法,测试环境winxp. 一.Chrome*浏览器 chrome模 ...
随机推荐
- HTML 事件(二) 事件的注册与注销
本篇主要介绍HTML元素事件的注册.注销的方式. 其他事件文章 1. HTML 事件(一) 事件的介绍 2. HTML 事件(二) 事件的注册与注销 3. HTML 事件(三) 事件流.事件委托 4. ...
- ASP.NET Core中如影随形的”依赖注入”[下]: 历数依赖注入的N种玩法
在对ASP.NET Core管道中关于依赖注入的两个核心对象(ServiceCollection和ServiceProvider)有了足够的认识之后,我们将关注的目光转移到编程层面.在ASP.NET ...
- [C#] C# 知识回顾 - 你真的懂异常(Exception)吗?
你真的懂异常(Exception)吗? 目录 异常介绍 异常的特点 怎样使用异常 处理异常的 try-catch-finally 捕获异常的 Catch 块 释放资源的 Finally 块 一.异常介 ...
- mybatis_常用标签
1.<where></where>标签的作用 可以动态的添加where关键字 可以自动去掉第一个拼接条件的and关键字 <where> <if test=&q ...
- Discuz论坛黑链清理教程
本人亲测有效,原创文章哦~~~ 论坛黑链非常的麻烦,如果你的论坛有黑链,那么对不起,百度收录了你的黑链,不会自动删除,需要你手动去清理. 什么是黑链 黑链,顾名思义,就是一些赌博网站的外链,这些黑链相 ...
- trigger事件模拟
事件模拟trigger 在操作DOM元素中,大多数事件都是用户必须操作才会触发事件,但有时,需要模拟用户的操作,来达到效果. 需求:页面初始化时触发搜索事件并获取input控件值,并打印输出(效果图如 ...
- TFS 生成配置
生成
- weinre- 调试移动端页面
相信很多前端的小伙伴一定会遇到一个问题, 比如我编写完一个页面,某个地方需要进行调整细节或者是哪个地方怎么调整都不对,在pc端还好,有google,firefox之类可以调节页面的工具,虽说这些工具有 ...
- 如何在Open Live Writer(OLW)中使用precode代码高亮Syntax Highlighter
早先Microsotf的Windows Live Writer(WLW)现在已经开源了,并且更名为Open Live Writer,但是现在Windows Live Writer还是可以现在,Open ...
- ASP.NET MVC 5 Web编程3 -- Controller的应用及扩展
Controller基础 一. 访问修饰符 1.1 类的访问修饰符 Controller类的访问修饰符必须是public,url才能被拦截. internal能编译通过,但无法拦截url请求.priv ...