使用weinre远程调试网页
2015-02-11 19:11
615 查看
weinre主页 http://people.apache.org/~pmuellr/weinre/docs/latest/Home.html
1 下载nodejs并解压至 nodejsproject/
2 安装weinre
nodejsproject/bin/npm install weinre #使用nodejs提供的npm 否则会出错
3 启动weinre
nodejsproject/node_modules/weinre [someoption]
options:
--httpPort port to run the http server on default: 8081
--boundHost ip address to bind the server to default: localhost //建议修改为 -all- 监听所有ip
--verbose print more diagnostics default: false
--debug print even more diagnostics default: false
--readTimeout seconds to wait for a client message default: 5
--deathTimeout seconds to wait to kill client default: 3*readTimeout
(手机和服务器必须在同一网段,可以相互访问)
可以在创建配置文件 ~/.weinre/server.properties
配置文件格式:
注意:命令行参数优先级高于配置文件
详细的参数 --help
4 调试
1 手机:访问 weinre 服务器, xx.xx.xx.xx:8081
2 手机:在页面上找到 Target Bookmarklet, 复制下面的js代码,类似下面的格式 地址后面的anonymous可以修改以方便区分不同手机
可以将js代码保存到书签
3 手机:打开新的标签页,访问要调试的网页 www.aaa.com/1.html
4 手机:在www.aaa.com/1.html所在的标签页点击我们保存的书签,可以将我们的代码注入到当前页面,
或者 直接粘贴js代码到地址栏,回车 注入代码
5 pc端:访问(wenkit内核的浏览器) http://xx.xx.xx.xx:8081/ 在access point下访问 http://xx.xx.xx.xx:8081/client/#anonymous
6 pc端:在targets 和clients中分别选择要调试的目标网页和目标设备,然后点击上方的项目选择调试的项目,操作类似firebug
其他调试方法:
在html页面中直接引入js。
-----------------------------------------------
路径为了大家看起来直观所以不怎么规范 所以请勿照抄
1 下载nodejs并解压至 nodejsproject/
2 安装weinre
nodejsproject/bin/npm install weinre #使用nodejs提供的npm 否则会出错
3 启动weinre
nodejsproject/node_modules/weinre [someoption]
options:
--httpPort port to run the http server on default: 8081
--boundHost ip address to bind the server to default: localhost //建议修改为 -all- 监听所有ip
--verbose print more diagnostics default: false
--debug print even more diagnostics default: false
--readTimeout seconds to wait for a client message default: 5
--deathTimeout seconds to wait to kill client default: 3*readTimeout
(手机和服务器必须在同一网段,可以相互访问)
可以在创建配置文件 ~/.weinre/server.properties
配置文件格式:
boundHost: -all- httpPort: 8081 reuseAddr: true readTimeout: 1 deathTimeout: 5 //建议这个时间可以改大一点,要不然调试的连接经常会断开
注意:命令行参数优先级高于配置文件
详细的参数 --help
4 调试
1 手机:访问 weinre 服务器, xx.xx.xx.xx:8081
2 手机:在页面上找到 Target Bookmarklet, 复制下面的js代码,类似下面的格式 地址后面的anonymous可以修改以方便区分不同手机
javascript:(function(e){e.setAttribute("src","http://xx.xx.xx.xx:8081/target/target-script-min.js#anonymous");document.getElementsByTagName("body")[0].appendChild(e);})(document.createElement("script"));void(0);
可以将js代码保存到书签
3 手机:打开新的标签页,访问要调试的网页 www.aaa.com/1.html
4 手机:在www.aaa.com/1.html所在的标签页点击我们保存的书签,可以将我们的代码注入到当前页面,
或者 直接粘贴js代码到地址栏,回车 注入代码
5 pc端:访问(wenkit内核的浏览器) http://xx.xx.xx.xx:8081/ 在access point下访问 http://xx.xx.xx.xx:8081/client/#anonymous
6 pc端:在targets 和clients中分别选择要调试的目标网页和目标设备,然后点击上方的项目选择调试的项目,操作类似firebug
其他调试方法:
在html页面中直接引入js。
<script src="http://xx.xx.xx.xx:8081/target/target-script-min.js"></script>
-----------------------------------------------
路径为了大家看起来直观所以不怎么规范 所以请勿照抄
相关文章推荐
- 使用weinre远程调试手机网页(nodejs、phoneGap)
- nodejs使用weinre远程调试手机网页
- 使用weinre远程调试
- weinre远程调试工具安装及其使用方法
- 使用weinre通过PC浏览器调试手机网页
- 远程调试weinre的使用
- 调试移动端网页工具Weinre使用整理
- 使用weinre在PC端同步远程调试移动端页面(在xampp上部署项目到Tomcat,并通过外网访问(图解). )
- 如何使用weinre来进行远程调试phonegap应用
- 远程调试工具weinre使用教程
- 使用weinre对WebApp页面dom进行远程调试
- 使用firefox的firebug插件进行网页js调试----firebug使用
- 使用firefox的firebug插件进行网页js调试----firebug使用
- 使用VS2008调试远程主机
- 使用gdbserver远程调试
- 使用Eclipse远程调试发布在Tomcat上的Web应用
- 使用VS2005搭建典型高效的SharePoint开发环境,提高生产效率,包含远程调试,自动部署
- 使用Eclipse远程调试Java web应用
- web developer tips (17):远程调试使用IIS的web应用
- web developer tips (17):远程调试使用IIS的web应用