3

我是 windows phone 开发的新手,发现我不知道如何使用 windows phone 模拟器调试 cordova/phonegap 应用程序。

我发现使用weinre从这里)可以调试应用程序,但仍然没有找到如何将它与模拟器连接(<script src="http://127.0.0.1:8080/client/#anonymus"></script>在 index.html 中使用没有工作)

所以,我对 2 个可能的问题有 2 个可能的答案:

1) 如何为 windows phone 调试我的 cordova/phonegap 应用程序?

2)如果使用 weinre,我怎样才能让它工作,以便我可以调试我的应用程序?

4

1 回答 1

3

Ensure that you have created the Windows Phone project in VS. 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

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). 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. Let's create the Windows Phone HTML5 application. 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:

<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. If everything went as we expected in the Debug Client user Interface on the Server we should see one Target connected:

Once the target Windows Phone page is connected you can inspect and change the DOM in real-time

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...

于 2014-07-23T11:52:03.977 回答