美文网首页
weinre 调试移动端

weinre 调试移动端

作者: codeice | 来源:发表于2016-06-29 15:10 被阅读88次

weinre 安装

npm install weinre -g

weinre 三大服务

1.调试服务器(Debug Server)

这是一个HTTP服务器,你能从weinre-node运行。这个HTTP服务会被Debug Client和Debug Target调用。

2.调试客户端(Debug Client)

这个是一个Web Inspector用户界面(类似于Firefox's Firebug、chrome's web Isnspector);它包含常用的Elements、Resoureces、Network、TimeLine和Console面板,此外它还有一个Remote面板。

3.调试目标(Debug Target)

 这是你想要进行调试的web页面。这个名字(Debug Target)也用于表示运行调试页面的设备

其中Debug Client和Debug Target是基于HTTP通过XMLHttpRequest(XHR)与Debug Server进行通信。通常Debug Client和Debug Server运行在桌面上,而Debug Target运行在移动设备中。不过要让Debug Target起作用,需要向调试页面中注入Debug Server提供的JavaScript代码片段。

启动服务

weinre --boundHost [ip] --httpPort [port]

调试目标

在需要被调试的其实页面加入代码

<script src="http://172.16.193.4:8001/target/target-script-min.js#anonymous"></script>

调试客户端

浏览器中打开http://172.16.193.4:8001/client,进行调试

参考:http://people.apache.org/~pmuellr/weinre/docs/latest/Home.html

相关文章

网友评论

      本文标题:weinre 调试移动端

      本文链接:https://www.haomeiwen.com/subject/ezkxjttx.html