Many friends of mine have been asking me what my team is working on these days. I finally have an opportunity to share with all of you the really cool stuff we’ve been working on for the past many months.
My team built the Windows Simulator enabling users to debug Metro style apps for Windows 8 in a Windows environment.
There are three primary ways to debug a Metro style app.
- Local Machine
- Remote Machine
Primary Usage Scenarios for Windows Simulator
There are certain features and traits in Metro style applications that helps them stand out compared to classic windows applications. For a better understanding of Metro style applications, I strongly recommend viewing the BUILD session by Jensen Harris on 8 traits of great Metro style apps before you start writing any Metro style applications.
The Windows Simulator is really handy when you need to verify how Metro style applications measure against these traits. I will introduce them here briefly and later we will have a detailed blog post on each of them.
- Touch Emulation
- Different target screen resolutions
Under the hood
Under the hood the Windows Simulator is a Remote Desktop Session into your local machine.
Developers need to be careful while modifying the state of the operating system in the Simulator because any changes in the Simulator will be reflected on the local machine itself. Multiple instances of Visual Studio and Expression Blend share the same instance of the Windows Simulator.
Using Simulator to debug Metro style applications in Visual Studio
To debug an Metro style application using Windows Simulator, Open the application project in Visual Studio and choose Simulator from the debugging options in the Visual Studio toolbar.
Or you can enable Simulator from the Debugging tab of Project Property Pages.
After selecting Simulator to debug the application, simply press F5 or start debugging from the tool bar to launch a Metro style application in the Windows Simulator.
To stop debugging choose “Stop Debugging” from the Debug menu of Visual Studio.
Using the Simulator from Expression Blend
Open the project in Expression Blend and then switch to the Platform panel and choose the Simulator as the Deploy target.
Then press F5 to launch application in Windows Simulator.
This feature is very useful to test Touch responsiveness for the application on developer machines that do not have touch devices. The Simulator supports single finger touch, tap and hold, pinch and zoom, and rotation. The touch controls are available in the Simulator Palette.
To switch out of touch emulation mode and back into mouse mode, select the mouse pointer. To learn more about Touch Emulation, see this blog entry.
Metro style applications should support Landscape and Portrait modes. Visual Studio templates are pre-configured for default behavior for landscape and portrait modes.
Without using an actual tablet device it is not easy to test the application in Portrait and Landscape mode. The Simulator is your friend here.
It is very easy to test the Landscape and Portrait modes using the rotation controls on the Simulator Palette.
Multiple screen Resolutions
Windows 8 can run on PCs of different screen sizes and Resolutions. Metro style applications should adjust to accommodate various screen sizes and resolutions. Using The Simulator it is very easy to test applications for different screen resolutions. You can use the “Change Resolution” button on the Palette to choose a resolution. The availability of resolutions in the Palette depends upon the supported resolutions of your video card.
Almost all the contracts in Metro style applications disappear once they lose focus or hit a breakpoint in debugger. It is not possible to debug contracts on your Local Machine without the Simulator. The Simulator is running a different desktop session, so when a breakpoint is hit in the debugger it does not result in a loss of focus in the simulator session.
I hope that you will find Simulator handy in time of need :), please post comments if you have any questions or feedback.
To learn more about developing Metro style applications for Windows 8 I highly recommend following //BUILD presentations.
Software Design Engineer, Visual Studio