Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 997
user206481 Avatar asked Mar 05 '13 22:03

user206481


2 Answers

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.
like image 166
fabian Avatar answered Sep 28 '22 18:09

fabian


In Visual Studio 2013

to see JavaScript console output, click:

DEBUGWindowsJavaScript Console

or use a shortcut to open the console:

CTRL + ALT + V, C

like image 36
Beat Avatar answered Sep 28 '22 19:09

Beat