Testing
an application on a Windows Phone device is a lot more work than using
the Windows Phone emulator, because it involves registering your device,
physically connecting it to your computer via a USB cable, and running
Zune software in the background on your workstation. Here are the steps
you need to follow to set up a phone as your debugging platform.
First, you must apply for a Windows Phone Marketplace account at the Windows Phone developer portal.
Microsoft will review
your application and activate your account. If you have not yet
installed Zune software, you can download the latest Zune software from www.zune.net/en-us/products/software/download/default.htm.
Once you're approved, click the Windows Start menu on your workstation and select All Programs =>Zune to start the Zune software, whose Welcome page is shown in Figure 1.
NOTE
The Windows Phone 7 device
is based on the Zune, which is a Microsoft product and iPod competitor
for playing video and audio. A Windows Phone uses Zune software to
update a Windows Phone 7 system, and Zune must be running in order to
deploy an application to a device. Also you can use Zune software to
back up your device.
Connect your Windows Phone device to your developer workstation using a USB cable.
To
confirm that your device is properly connected and recognized by the
Zune software, click the phone icon at the bottom left corner of the
Zune Welcome screen, as indicated by the arrow in Figure 2.
When you click the phone icon, the Zune software will display detailed information about your device, as shown in Figure 3.
Now you are ready to actually register your device.
Go to the Windows Start menu, select All Programs =>Windows Phone Developer Tools, and select Windows Phone Developer Registration, as shown in Figure 4.
A Windows Phone developer registration form will display, as shown in Figure 5.
Enter the ID and password that you used to register for a Windows Phone Marketplace account in Step 1.
To confirm that your phone is properly registered, go to http://developer.windowsphone.com/ and log in.
Once logged in, click Account and select DEVICE REGISTRATION from left side menu, as shown in Figure 6. You should see a list of the devices you have registered.
In the following section,
you will learn tips and tricks to make your life easier when you begin
to debug and test using a real device.
Here are a few things that
you should keep in mind to make your life easier and save you time when
you're debugging an application on a live Windows Phone.
When
debugging it is best to disable screen time-out, especially if you are
debugging through a complex program that takes a long time. On the
Windows Phone device, go to Settings => Lock & Wallpaper and set the screen time-out to never. Remember to come back to reset the screen time-out to other than never so you don't waste your battery. When
you try to debug in the Windows Phone 7 device, you will get the error
message shown here. And when you click No, you will see an "Access
Denied" message in your Error List window. This is because your device
is locked due to time-out. To avoid this problem during the debugging,
you would want to disable time-out on the device by following Step 1. To
resolve this issue, simply unlock your device and restart in debug mode
in Visual Studio.
When
the Zune application is not started, you will receive the error "Zune
software is not launched. Retry after making sure that Zune software is
launched" in the Visual Studio Error List Window.
|