[英]How to debug phonegap windows phone 8.1
I'm new to windows phone development and found that I don't know how to debug a cordova/phonegap app with windows phone emulator. 我是Windows手机开发的新手,发现我不知道如何使用Windows Phone模拟器调试cordova / phonegap应用程序。
I found out that using weinre
( from here ) it's possible to debug app, but still haven't found how to connect it with emulator (Using <script src="http://127.0.0.1:8080/client/#anonymus"></script>
in index.html have not worked) 我发现使用weinre
( 从这里 )可以调试应用程序,但仍然没有找到如何将其与模拟器连接(使用<script src="http://127.0.0.1:8080/client/#anonymus"></script>
index.html中的<script src="http://127.0.0.1:8080/client/#anonymus"></script>
没有工作)
So, I have 2 possible answers to 2 possible questions: 所以,我对2个可能的问题有两个可能的答案:
1) How can I debug my cordova/phonegap app for windows phone? 1)如何调试Windows phone的cordova / phonegap应用程序?
2) If using weinre, how can I make it work so I can debug my app? 2)如果使用weinre,我怎样才能使它工作,以便我可以调试我的应用程序?
Ensure that you have created the Windows Phone project in VS. 确保您已在VS中创建了Windows Phone项目。 If you can run it on the device then it should work with the following. 如果您可以在设备上运行它,那么它应该使用以下内容。 Taken from this site: http://sviluppomobile.blogspot.cz/2013/03/how-to-debug-windows-phone-html5-apps.html 摘自本网站: http : //sviluppomobile.blogspot.cz/2013/03/how-to-debug-windows-phone-html5-apps.html
You can verify if the server started by opening a browser page and loading 127.0.01:8080 (8080 is the default port for Weinre). 您可以通过打开浏览器页面并加载127.0.01:8080来验证服务器是否已启动(8080是Weinre的默认端口)。 If you are seeing this page then the server is running: 如果您看到此页面,则服务器正在运行:
Now click on the Debug Client User Interface link where you will be able to see if any client is connected and debug the connected clients. 现在单击Debug Client User Interface链接,您可以在其中查看是否已连接任何客户端并调试已连接的客户端。 Let's create the Windows Phone HTML5 application. 让我们创建Windows Phone HTML5应用程序。 Use the SDK template to create a new project, open the page index.html inside the folder Html and add this line to the head section: 使用SDK模板创建一个新项目,在文件夹Html中打开index.html页面并将此行添加到head部分:
<script src="http://[the server ip]:8080/target/target-script-min.js#anonymous"></script>
replace [the server ip] with the IP of the PC running the Winre server and run the application. 将[服务器ip]替换为运行Winre服务器的PC的IP并运行该应用程序。 If everything went as we expected in the Debug Client user Interface on the Server we should see one Target connected: 如果一切按照我们在服务器上的Debug Client用户界面中的预期进行,我们应该会看到一个Target已连接:
Once the target Windows Phone page is connected you can inspect and change the DOM in real-time 连接目标Windows Phone页面后,您可以实时检查和更改DOM
Failing that you can always run the site in IE11 and change its settings to emulate a Windows Phone device, then use the inbuilt IE debug tools, but that obviously doesn't debug on the device... 如果失败你总是可以在IE11中运行该站点并更改其设置以模拟Windows Phone设备,然后使用内置的IE调试工具,但这显然不会在设备上调试...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.