二. Weinre 调试 IOS Hybrid APP

1. 安装weinre

npm install –g weinre

2. 打开

weinre -httpPort 8080 -boundHost -all-

 

httpPort 监听端口

boundHost 绑定主机

eg.

weinre -httpPort 8080 -boundHost 172.16.144.11

 

成功后会出现相应信息(不要关掉cmd)

c:Usersxxxxx>weinre -httpPort 8080 -boundHost 172.16.144.11
2014-12-11T03:34:11.827Z weinre: starting server at http://172.16.144.11:8080

 

3.Chrome 访问 http://172.16.144.11:8080 不出意外的话可以看到weinre的基本信息。

4.把 target script 加入到要调试的appindex.html页面中。(可以用iTools导出要调试的app的html页面修改后再导入)

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

5.Chrome 访问http://172.16.144.11:8080/client/#anonymous 就可以调试页面了。(可能会慢一点,需要等一会儿)

6.手机端app 要设置代理到本机。本机打开Fiddle

原文地址:https://www.cnblogs.com/alex-zhao/p/4157303.html