Debugging with a WinRT Device

Một phần của tài liệu Direct 2D Succinctly Guide by Chris Rose (Trang 22 - 25)

All of the code in this book works for Windows 8 PCs as well as WinRT devices. If you are authoring software for a WinRT tablet and have a real device, it is very beneficial to use it for debugging and testing your application instead of an emulator (which is usually the default). Most of the code in C++ and DirectX works fine on a Windows 8 PC, as well as a WinRT device

(compiled for the ARM target). The emulators are good but can never match the exact characteristics of a real device.

Install the Remote Tools

Install the remote tools for Visual Studio 2012 onto the device. This is available from the Microsoft website (available from http://www.microsoft.com/visualstudio/eng/downloads#d-additional-

software). It is a service that connects with the Visual Studio development machine to run and debug the app on the device. All the regular debugging mechanisms are available from Visual Studio such as break points, examining the ARM registers, and Memory windows. You need to know the name of the device in order to deploy an application onto it. You also need to have the device run the Remove Debugging Monitor that comes with the previously mentioned installation.

Each build configuration (Release x86, Debug x86, Release ARM, etc.) you want the device to run must have the device's name in its project settings.

Change the application to ARM

If the WinRT device that you are deploying to is ARM based, such as a Microsoft Surface, you can change the configuration for the project from the main menu by selecting ARM.

Figure 8: Configurations Change debugging to Remote Machine

If it is not set already, you should change the debugging to Remote Machine.

Figure 9: Machine Name

Specify the Name of the Remote Machine

Open the Project > [Name] Properties page from the main menu of Visual Studio or right-click on your project's name in the Solution Explorer and click Properties on the context menu. This will open the properties page for the project. Click Debugging on the left panel and type the name of your remote machine into the space labeled Machine Name.

Figure 10: Remote Machine

Run the Remote Debugger

Run the remote debugging service on the device and you should be able to start debugging from Visual Studio 2012 as usual (press F5 or click the start debugging button). The first thing you will see on the device (Visual Studio Remote debugger's window) says it is connected to the

development computer with a message like the following:

3/01/2013 2:48:40 PM [MachineName]\[ComputerName] connected

Shortly after this you will see a message in the output window of Visual Studio saying it is uploading the program to the device. This takes some time, but once the upload is complete the application should run.

Here are some ideas if you are unable to debug the application from the device, or it does not run as expected:

 Make sure you have the correct remote debugging tools installed on the device. Install the tools for Visual Studio 2012. Always download this directly from the Microsoft website and download any available updates to ensure the current remote debugging supports your particular device.

 Make sure you have spelled the name of the remote machine correctly in the project

properties. The remote machine name was chosen when Windows RT was first installed on the machine. You can see the name of the remote machine in the Remote Debugger window if you have forgotten or are unsure what the remote machine is called. At present, the case of the name in the properties of the project is irrelevant, but the machine uses all uppercase so you might try to match the exact case the machine is using.

 Make sure the current configuration has the name of the remote machine specified in its debugging field in the properties page. You need to put the name of the device in each configuration. For instance, if you use Debug and Release, you need to specify the remote machine's name in both.

Finally, if the application is not executing as expected but is running, ensure the code you have used is completely portable to WinRT. Be aware that these devices do not have a dedicated graphics card. They rely on a scaled down, portable, and energy efficient CPU/GPU combination.

The version of DirectX 11 which runs on these devices is also scaled down. It does not contain the full capabilities of the DirectX 11 standard. The operating system itself (Windows RT) is a scaled down version of the full Windows 8, and many features are missing (free access to the file structure, for instance).

Một phần của tài liệu Direct 2D Succinctly Guide by Chris Rose (Trang 22 - 25)

Tải bản đầy đủ (PDF)

(187 trang)