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模 ...
随机推荐
- Android探索之AIDL实现进程间通信
前言: 前面总结了程序间共享数据,可以使用ContentProvider也可以使用SharedPreference,那么进程间怎么共享内存呢?Android系统中的进程之间不能共享内存,因此,需要提供 ...
- 【开源】.Net 分布式服务中心
分布式服务中心 开源地址: http://git.oschina.net/chejiangyi/Dyd.BaseService.ServiceCenter 当垂直应用越来越多,应用之间交互不可避免,将 ...
- TypeScript为Zepto编写LazyLoad插件
平时项目中使用的全部是jQuery框架,但是对于做webapp来说jQuery太过于庞大,当然你可以选择jQuery 2.*针对移动端的版本. 这里我采用移动端使用率比较多的zepto框架,他跟jqu ...
- 算法与数据结构(十三) 冒泡排序、插入排序、希尔排序、选择排序(Swift3.0版)
本篇博客中的代码实现依然采用Swift3.0来实现.在前几篇博客连续的介绍了关于查找的相关内容, 大约包括线性数据结构的顺序查找.折半查找.插值查找.Fibonacci查找,还包括数结构的二叉排序树以 ...
- Win.ini和注册表的读取写入
最近在做打包的工作,应用程序的配置信息可以放在注册表文件中,但是在以前的16位操作系统下,配置信息放在Win.ini文件中.下面介绍一下Win.ini文件的读写方法和注册表的编程. 先介绍下Win.i ...
- 你真的会玩SQL吗?之逻辑查询处理阶段
你真的会玩SQL吗?系列目录 你真的会玩SQL吗?之逻辑查询处理阶段 你真的会玩SQL吗?和平大使 内连接.外连接 你真的会玩SQL吗?三范式.数据完整性 你真的会玩SQL吗?查询指定节点及其所有父节 ...
- javascript中变量提升的理解
网上找了两个经典的例子 var foo = 1; function bar() { if (!foo) { var foo = 10; } alert(foo); } bar(); // 10 var ...
- bzoj3932--可持久化线段树
题目大意: 最近实验室正在为其管理的超级计算机编制一套任务管理系统,而你被安排完成其中的查询部分.超级计算机中的 任务用三元组(Si,Ei,Pi)描述,(Si,Ei,Pi)表示任务从第Si秒开始,在第 ...
- SMBus set up a 2-byte EEPROM address for read/write
Sequencer Engine spec: http://www.analog.com/media/en/technical-documentation/data-sheets/ADM1260.pd ...
- FineReport:任意时刻只允许在一个客户端登陆账号的插件
在使用FineReport报表系统中,处于账户安全考虑,有些企业希望同一账号在任意时刻智能在统一客户端登录.那么当A用户在C1客户端登陆后,该账号又在另外一个C2客户端登陆,服务器如何取判断呢? 开发 ...