1.介绍
weinre是远程调试工具,适合移动端web调试
2.安装
npm instanll -g weinre
3.运行
weinre --httpPort 8081 --boundHost -all-
httpPort 调试服务器运行的端口,默认8080
boundHost 调试服务器绑定的ip地址或域名,默认localhost
4.使用
获取本机的ip
比如我的ip为192.168.1.35,则在html添加
<script src="http://192.168.1.35:8081/target/target-script-min.js#anonymous"></script>
当我在移动端访问http://192.168.1.35:6001,是可以在
http://localhost:8081/client/#anonymous 下看到下图
这样可以很方便去调试样式,兼容性之类的。
调试完之后,记得去掉调试代码。