Search code examples
javascriptcordovawindows-phone-8weinre

How to debug cordova/phonegap for windows phone


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.

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/"></script> in index.html have not worked, somehow it doesn't load all data like time response)

How can I debug my cordova/phonegap app for windows phone?


Solution

  • The easiest way to debug a Windows Cordova/Phonegap app is from Visual Studio. When you create your project and then add the Windows platform:

    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. 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, and then hit F5 to start debugging. That's it!