Deploying a Windows Phone Game
Describes how XNA Game Studio can copy executable and media files to a Windows Phone emulator or device once you are ready to deploy them. As you develop your Windows Phone game, it is convenient to be able to deploy your game executable to an emulator or your device for testing purposes.
Selecting a Windows Phone Device or Emulator
The active Windows Phone device or emulator for deployment is selected through the XNA Game Studio Device Management toolbar.
Figure 1. Windows Phone selections in the XNA Game Studio Device Management** toolbar**
If the toolbar is not visible, on the View menu, click Toolbar, and then select XNA Game Studio Device Management.
Note
The default is the first listed Windows Phone emulator. At this time, the default device cannot be changed.
Deploying Your Game
This procedure shows you how to deploy your Windows Phone game from XNA Game Studio to a Windows Phone emulator or device. This assumes you already have a connection between that device and your computer.
To deploy your Windows Phone game
Ensure there is a connection between the device and your computer.
Load a Windows Phone Game project into XNA Game Studio
On the View menu, click Output, or press CTRL+W, and then press the letter O on the keyboard.
Best Practice Ensure the Output window is visible so you can follow the progress of your deployment in detail. If a problem occurs, this information will help you to determine its likely source. In XNA Game Studio, deploy the game.
- Right-click the solution name, and then select Deploy Solution.
Or
- On the Build menu, select Deploy Solution.
During this process, the Output window shows the deployment progress. You can view a list of the deployed files and some additional information.
Tip
To build, deploy and run your game without debugging, press CTRL+F5.
Start the game from the application list on the device.
Incremental Deployment
When enabled, incremental deployment permits XNA Game Studio to track which files have already been deployed to the device. In subsequent deployments, XNA Game Studio transfers only the files that have changed, or delete files from the device that are no longer part of the project. This limits the time required to redeploy your game to the device.
Note
Incremental deployment for Windows Phone games is not supported in this release of XNA Game Studio 4.0.
Cleaning the Solution Before You Build
Cleaning your game solution before you build removes all intermediate and output files generated by the build. This forces the next build to regenerate everything.
If you select Rebuild on the Build menu, the build automatically regenerates everything. However, you may also want to clean your solution before doing a build. This is particularly true if there are unexpected build errors.
In Microsoft Visual C# Express Edition, the Clean Solution option is not included in the Build menu by default. However, it is easy to add if you want to make cleaning your solution convenient.
To add the Clean Solution option
In XNA Game Studio, right-click the menu or toolbar at the top of the window, and then click Customize.
In the Customize dialog box, click on the Build menu (or on any other menu where you want to add the command).
This opens the menu, and leaves it open.
In the Customize dialog box, click the Commands tab, and then select Build from the Categories pane on the left.
In the Commands pane on the right, drag the Clean Solution command into the open Build menu, and drop it where you want it.
Close the dialog box.
Now, whenever you want to clean the solution, just click Clean Solution from the menu where you added it.