移动调试工具weinre安装和使用


weinre主页

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

weinre调试服务器基于node.js实现,因此先安装node 运行环境。

1下载并安装node管理工具

http://nodejs.org/download/

2。windows上使用 Node.js Command prompt安装

npm install weinre



weinre安装成功


3运行weinre

打开命令行输入


node.exe node_modules\weinre\weinre --boundHost -all-
 
 
 
 

 
 
这个时候在浏览器输入
http://localhost:8080/
就可以看到如图效果
 
 
 
 
 
 


说明服务正常,


在命令行中输入

node.exe node_modules\weinre\weinre --boundHost 192.168.137.1

可以指定当前机器的IP,然后可以供移动设备访问,


这个时候就可以在移动设备上测试下是否能访问weinre 的服务器,如果不能访问,要看下防火墙的配置。


在命令行输入

node.exe node_modules\weinre\weinre --help
可以返回相关的使用命令



比如--httpPort 修改运行weinre 服务的端口

输入以下命令可以修改端口号为8089

node.exe node_modules\weinre\weinre --httpPort 8089



打开

http://localhost:8089/

则可以看到如下页面


点击

http://localhost:8089/client/#anonymous

进入到userinterface(用户界面)




可以在要调试的页面中加入此行代码。

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

然后访问欲调试页面,再打开

http://192.168.137.1:8089/client/#anonymous

就可以实时进行调试了。





如果懒得自己搭建环境,也可以使用phonegap的服务

打开网站http://debug.phonegap.com/


Step 1: select your guid ( or just use the one we've randomly assigned)
Step 2: inject this script into your index.html
<script src="http://debug.phonegap.com/target/target-script-min.js#anonymous"></script>
Step 3: click this link to start debugging
http://debug.phonegap.com/client/#anonymous


node.exe node_modules\weinre\weinre --boundHost 192.168.1.1


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值