二. Weinre 调试 IOS Hybrid APP

1. 安装weinrehtml

npm install –g weinrenpm

2. 打开app

weinre -httpPort 8080 -boundHost -all-spa

 

httpPort 监听端口代理

boundHost 绑定主机调试

eg.orm

weinre -httpPort 8080 -boundHost 172.16.144.11server

 

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

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

 

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