电话weinre没有发现任何目标

我尝试启用weinre进行debugging,但是问题在于weinre找不到目标。

这是我做的:

  1. 通过nodejs命令安装weinre:npm install weinre -g

  2. 通过USB线连接我的android设备(Huawaei智能手机),并在android手机上启用debugging模式。

  3. 开始weinre,命令:weinre –boundHost 192.168.2.1

index.html如下所示:

<!doctype html> <html> <head> <title>tittle</title> <!-- Weinre testing for remote debug with physical device --> <script src="http://192.168.2.1:8080/target/target-script-min.js#anonymous"></script> <script>window.location='./main.html';</script> <body> </body> </html> 

在我添加的config.xml

  <access origin="http://192.168.2.1:8080/*" /> 

最后在main.html(这是真正的起始页面)我补充说:

 <script type="text/javascript" charset="utf-8" src="cordova.js"></script> 
  • 然后我压缩应用程序所需的所有文件,并将其上传到phonegap构build。 在phonegapbuild立所有应用程序后,我用移动设备扫描bardcode。 现在设备开始下载应用程序。

我在设备上启动应用程序。 并访问该网站

 http://192.168.2.1:8080/client/#anonymous 

=>应用程序开始,但是网站weinre-server显示“Target:NONE”

我错过了什么? 我在Firefox和Chrome上尝试了这个过程。 我很确定移动设备不使用与我的台式机相同的“本地主机”。

weinre服务器属性是:

在这里输入图像描述

我遇到同样的问题,因为在导入脚本时,我使用“localhost:8080 / target / target-script-min.js#anonymous”而不是真实IP。 当我使用真正的IP,目标被发现