Cordova – How to see javascript console output from Windows Phone 8 Emulator or device running Phonegap app

cordovaphonegap-buildwindows-phone-8

I am developing a mobile app using Phonegap Build to generate for different mobile platforms. I have successfully deployed and debugged my APK file on Android devices using adb tools and ddms. Now on to Windows Phone 8, but I am having trouble figuring out how to debug.

I have a Windows 8 Pro machine and have successfully installed Windows Phone SDK, deployed the XAP file to both the emulator and a Windows Phone 8 device using the Application Deployment tool (got the MS Dev subscription, registered the phone, all that stuff). The app loads but appears to not receive the deviceready event, but I really have no idea because I can't see the console log.

The SDK came with Visual Studio Express, but I don't see how to open an XAP to run it from VS so the output might go to the VS debug windows. Is there any way to see the console.log statements from my XAP from Phonegap Build? or must I create a VS project and compile/run from there?

Best Answer

Right click project > Properties > Build > check Define DEBUG constant

If option is disabled, stop code execution ( Shift + F5 )

Messages should go to the Output window. To open it up go to View > Output ( Alt + 2 )

Edit:

For Visual Studio 2013, it seems like the following would work.

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Compile tab.
  3. Click the Advanced Compile Options button to open the Advanced Compiler Settings dialog box.
  4. Select the Define DEBUG constant check box, and then click OK.
Related Topic