使用weinre调试移动端访问的页面

一、安装

npm -g install weinre


二、启动服务器
weinre [options]  
//The server will run until you kill it. Control-C will do the job.
Options available are:
--help (or -? or -h)
Display this help.
--httpPort [portNumber]
--boundHost [hostname | ip address
--verbose [true | false]
--debug [true | false]

启动示例:weinre --boundHost 192.168.1.100 --httpPort 8081

成功访问http://192.168.1.100:8081/ ,表示服务端启动成功。 
三、使用:
1、在调试页面添加
<script src="http://192.168.1.100:8081/target/target-script-min.js#anonymous"></script>
2、用移动端浏览器访问要调试的页面.

3、用chrome访问http://192.168.1.100:8081/client/

而后可如chrome在pc上调试页面一样,看到页面的dom结构、网络请求等。效果如下。

使用weinre调试移动端访问的页面_第1张图片

你可能感兴趣的:(weinre,移动端页面调试)