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模 ...
随机推荐
- ASP.NET Web API 跨域访问(CORS)
一.客户端用JSONP请求数据 如果你想用JSONP来获得跨域的数据,WebAPI本身是不支持javascript的callback的,它返回的JSON是这样的: {"YourSignatu ...
- .NET 基础 一步步 一幕幕[面向对象之构造函数、析构函数]
构造函数.析构函数 构造函数: 语法: //无参的构造函数 [访问修饰符] 函数名() :函数名必须与类名相同. //有参的构造函数 [访问修饰符] 函数名(参数列表):函数名必须与类名相同. 作用: ...
- 第一个shell脚本
打开文本编辑器,新建一个文件,扩展名为sh(sh代表shell),扩展名并不影响脚本执行,见名知意就好. #!/bin/bash echo "Hello World !" &quo ...
- Android数据加密之SHA安全散列算法
前言: 对于SHA安全散列算法,以前没怎么使用过,仅仅是停留在听说过的阶段,今天在看图片缓存框架Glide源码时发现其缓存的Key采用的不是MD5加密算法,而是SHA-256加密算法,这才勾起了我的好 ...
- bzoj3208--记忆化搜索
题目大意: 花花山峰峦起伏,峰顶常年被雪,Memphis打算帮花花山风景区的人员开发一个滑雪项目. 我们可以把风景区看作一个n*n的地图,每个点有它的初始高度,滑雪只能从高处往低处滑[严格大于] ...
- listview下拉刷新和上拉加载更多的多种实现方案
listview经常结合下来刷新和上拉加载更多使用,本文总结了三种常用到的方案分别作出说明. 方案一:添加头布局和脚布局 android系统为listview提供了addfootview ...
- 豪情-CSS解构系列之-新浪页面解构-01
目录: 一. 新浪的布局特点 二. 内容细节的特点 三. 其中相关的一些基础技术点 1. 常见布局方法 2. 布局要点 3. Debugger误区 4.列表 5.字体颜色 6.CSS选择符 7.CSS ...
- Mono+Jexus部署C# MVC的各种坑
如果你看到这篇文章,先别急着动手,过完一遍,确定是你要的再动手. 别人提到的这里不赘述,只说查了好久才知道的. 1号坑:System.IO.FileNotFoundException Could no ...
- Storm构建分布式实时处理应用初探
最近利用闲暇时间,又重新研读了一下Storm.认真对比了一下Hadoop,前者更擅长的是,实时流式数据处理,后者更擅长的是基于HDFS,通过MapReduce方式的离线数据分析计算.对于Hadoop, ...
- 前端构建大法 Gulp 系列 (一):为什么需要前端构建
系列目录 前端构建大法 Gulp 系列 (一):为什么需要前端构建 前端构建大法 Gulp 系列 (二):为什么选择gulp 前端构建大法 Gulp 系列 (三):gulp的4个API 让你成为gul ...