设置Weinre远程调试 [英] Setting up weinre remote debugging
问题描述
运行weinre的说明我需要插入以下脚本:
Instructions for running weinre state that I need to insert following script:
<script src="http://a.b.c:8081/target/target-script-min.js"></script>
其中http://a.b.c
是我的服务器IP或主机名.
where http://a.b.c
is my server IP or host name.
问题对:
这是否意味着我必须在远程服务器上打开端口8081?
Does this mean that I must open port 8081 on my remote server?
target-script-min.js
又是什么?看来我需要将其上传到target
文件夹?
Also what is the target-script-min.js
? It looks like I need to upload it to a target
folder?
推荐答案
启动weinre服务器的方法是运行命令
The way you start the weinre sever is by running the command
weinre
在您的命令行中.然后,只要您仍在使用weinre,就可以让它继续运行.您可以通过weinre --help
类型找到此命令的选项,但是重要的选项是--boundHost
和--httpPort
. --boundHost
默认为localhost,--httpPort
默认为8080.因此,运行
in your command line. And then you leaving it running for as long as you're still using weinre. You have options for this command that you can find by type weinre --help
, but the important ones are --boundHost
, and --httpPort
. --boundHost
defaults to localhost and --httpPort
defaults to 8080. So run
weinre --boundHost 192.168.1.2
其中192.168.3.4是您的IP地址,您可以通过运行ipconfig来找到它.在代码中添加以下内容:
where 192.168.3.4 is your ip address, which you can find by running ipconfig. Put the following in your code:
<script src="http://192.168.1.2:8080/target/target-script-min.js#whatever"></script>
然后,在您的浏览器中,转到
Then, in your browser, go to
http://192.168.1.2:8080/client/#whatever
我在这里写了一篇关于它的博客文章: https://adam.garrett-harris.com/how-to-setup-remote-debugging-in-phonegap
I wrote a blog post about it here: https://adam.garrett-harris.com/how-to-setup-remote-debugging-in-phonegap
要回答第二个问题,target-script-min.js只是一个javascript文件,无论何时安装,它都是weinre的一部分.跑步时,您可以访问
To answer your second question, the target-script-min.js is just a javascript file that's a part of weinre whenever you install it. When you have weinre running, you can visit
http://192.168.1.2:8080/target/target-script-min.js
根据需要查看文件.
这篇关于设置Weinre远程调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!