简体   繁体   English

如何在Windows Phone模拟器中调试Cordova / PhoneGap应用

[英]How to debug cordova/phonegap app in windows phone emulator

I'm developing a windows phone app usign Cordova / Phonegap. 我正在开发Windows Phone应用程序usign Cordova / Phonegap。 I made it work for Android, but now that I'm trying wp for the first time I find myself with some unknown errors (some elements are not getting loaded). 我使它适用于Android,但现在我第一次尝试使用wp时,发现自己遇到了一些未知错误(某些元素未加载)。

How can I debug my javascript so I can get to know what is going wrong with my app? 如何调试JavaScript,以便了解我的应用程序出了什么问题?

It's very easy to debug a Windows Cordova/Phonegap app from Visual Studio. 从Visual Studio调试Windows Cordova / Phonegap应用程序非常容易。 When you create your project and then add the Windows platform: 创建项目然后添加Windows平台时:

cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add windows

Cordova will create a CordovaApp.sln file in the hello\\platforms\\windows directory. Cordova将在hello \\ platforms \\ windows目录中创建一个CordovaApp.sln文件。 Open that up in Visual Studio 2013 (or open CordovaApp.vs2012.sln if you have Visual Studio 2012), select the project you want to debug in the Solution Explorer pane, select the emulator you want to run it in in the toolbar (or select Device to run it on an actual device), and then hit F5 to start debugging. 在Visual Studio 2013中打开它(如果有Visual Studio 2012,则打开CordovaApp.vs2012.sln),在“解决方案资源管理器”窗格中选择要调试的项目,在工具栏中选择要运行的模拟器(或选择设备以在实际设备上运行它),然后按F5键开始调试。 You can set breakpoints in your Javascript code just like you would in C# or VB. 您可以像在C#或VB中一样在Javascript代码中设置断点。 Visual Studio运行菜单

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM