Until recently, the only way to debug applications built with OpenZDK has been “the hard way”: running the application over and over with message boxes inserted in strategic locations, something that is clearly not practical for software of any complexity. This is about to change. Client for Debugging finally makes it possible to debug OpenZDK applications just as you would Windows and XNA applications - right inside Visual Studio. Additionally, the filesystem and registry can now be accessed and manipulated directly using the remote tools included with Visual Studio.
Note that while it should be possible to implement a similar technique for debugging applications on classic Zune models, Client for Debugging is currently only compatible with the Zune HD.
Before you get started, make sure you have:
Client for Debugging requires certain files from Visual Studio that must be copied from the host system; therefore, the installer must be run on a system that has Visual Studio 2008 Professional installed.
The original release of Client for Debugging (0.1) was nonfunctional. If you downloaded 0.1, please make sure to update to the latest version.
To bring up the debugging server on the Zune, follow the procedure below:
The color of the four arrows on screen indicates the status of Client for Debugging:
Visual Studio must be configured with the IP address of the Zune in order to be able to connect.
Visual Studio provides a series of “remote tools” that can be used to access the Zune's registry, filesystem, and more.
Remote Zoom In, which captures a screenshot from a Windows CE device, yields only a blank image; screenshottr, documented below, is a Zune-specific replacement.
\Flash2\debug\$(SolutionName)\$(ProjectName)\\Flash2\Flash2\debug\$(SolutionName)\$(ProjectName)\$(TargetFileName)Once you have configured Visual Studio and your project for use with Client for Debugging, follow the steps below to begin using the debugger:
Debugging with Visual Studio works the same regardless of whether you are dealing with an XNA, OpenZDK, or ordinary Windows application. For more information on how to use the debugger, see the Debugger Roadmap on MSDN.
screenshottr provides a facility to take screenshots of OpenZDK applications through the Remote Tools Framework, a framework for building utilities that communicate through the debugging channel.
Note that the screenshots taken do not always accurately reflect the contents of the screen, especially when 3D is involved. The alpha channel is preserved when taking the screenshot, and applications that erroneously clear the screen with zero alpha will be captured without a background. The raw screenshots are alpha blended with a black background in the preview but are saved unmodified when exporting as a PNG file.
The Zune firmware will automatically disconnect from the wireless network after a period of about ten minutes of inactivity. This tends to frequently disrupt long debugging sessions. With any luck, this will be corrected in the next release.