Run Windows Store apps in the simulator
The Visual Studio simulator for Windows Store apps is a desktop application that simulates a Windows Store app. It lets a developer on a single machine run applications and simulate common touch and rotation events. You can also choose the physical screen size and resolution that you want to emulate, simulate the geo-location co-ordinates of user input events, and simulate network connection properties.
See Run Windows Phone apps in the emulator for Windows Phone information. |
Together with Visual Studio, the simulator provides an environment in which you can design, develop, debug, and test Windows Store apps. However, before you publish your app to the Windows Store, you should test your app on an actual device.
Warning
The Visual Studio simulator for Windows Store apps does not run in an isolated environment on your local machine. Therefore, errors that occur in the simulator, such as a non-recoverable system-wide error, can also affect the entire machine.
In this topic
You can learn how to:
Set the simulator as the target
Choose an interaction mode
Choose an individual action
Enable or disable Always on top mode
Change the device orientation
Change the simulated screen size and resolution
Set the simulated geo-location of the device
Capture a screenshot of your app for submission to the Microsoft Store
Simulate network connection properties
Navigate the simulator with the keyboard
Navigate the simulator toolbar
Shut down the simulator
Set the simulator as the target
To run your Windows Store app in the simulator, select Simulator from the drop-down list next to the Start Debugging button on the debugger Standard toolbar.
Choose an interaction mode
Mouse
Mouse mode
Sets the interaction mode to mouse gestures. Mouse gestures include clicks, double-clicks, and drags.
Single finger touch
Start touch emulation
Sets the interaction mode to touch gestures of a single finger. Single-finger events include tapping, dragging, and swiping.
The single target icon indicates the location of events in the simulator. Use the mouse to position the pointer. |
|
Press the left mouse button to activate the touch mode. For example, click the button to simulate a tap, or press and hold the button as you drag or swipe. |
Pinch and Zoom
Touch emulation pinch/zoom.
Sets the interaction mode to pinch and zoom gestures of two fingers.
The double target icon indicates the location of two fingers on the device screen.
|
|
|
Object rotation
Touch emulation rotate
Sets the interaction mode to rotation gestures of two fingers.
The double target icon indicates the location of two fingers on the device screen.
|
|
|
Choose an individual action
The following buttons generate single actions that are independent of the interaction mode.
Enable or disable Always on top mode
You can set the simulator window to always be on top of other windows.
Toggle Topmost Window Enables or disables Always on top mode of the simulator window. |
Change the device orientation
You can switch the device orientation between portrait and landscape by rotating the simulator 90 degrees in any direction.
Note
The simulator does not respect DisplayProperties.AutoRotationPreferences property of a project. For example, if your project sets the orientation to Landscape, and you then rotate the simulator to a portrait orientation, the simulator display image will also be rotated and resized. Test these settings on an actual device.
Rotate Simulator clockwise 90 degrees Rotates the simulator clockwise by 90 degrees. |
|
Rotate Simulator counter-clockwise 90 degrees Rotates the simulator counter-clockwise by 90 degrees. |
Note
If you rotate the simulator so that one edge of the simulator is larger than the screen it is displayed on, the simulator is automatically resized to fit within the screen. The simulator is not resized to its original size if you rotate it again.
Change the simulated screen size and resolution
To change the simulated screen size and resolution, choose the Change Resolution button on the palette and choose a new size and resolution from the list.
The screen size and resolution are listed as Screen width inches, pixel width X pixel height. Note that both the screen size and the resolution are simulated. Location co-ordinates on the simulator are translated to the co-ordinates of the selected device size and resolution.
Note
You can save scaled versions of bitmap images in your app and Windows will load the correct image for the current scale. See Guidelines for scaling to pixel density. However, if you change the simulator resolution so that Windows picks a different image to fit the resolution, you have to stop and restart your debug session to view the new image.
Set the simulated geo-location of the device
To test location-aware apps, use the Set Location dialog box.
Choose the Set Location button.
If you need to fulfill requirements, the Set Location dialog box appears.
Unfulfilled requirements in the list are marked with a red circle containing an 'X.'
If the requirement does not ask you to contact your system administrator, choose Configure to automatically correct the issue.
Otherwise, contact your system administrator to correct the issue.
On the Set Location dialog box, set the Latitude and Longitude values in decimal degrees.
Set the Altitude value to indicate the height of the position, specified in meters above or below the position. Use negative values to specify altitude that is below the position.
Set the Error Radius value to indicate the accuracy level of the latitude and longitude coordinates, specified in meters.
Capture a screenshot of your app for submission to the Windows Store
When you submit an app to the Windows Store, you must include screenshots of the app.
Note
The screenshot is saved at the current resolution of the simulator. To change the resolution, choose the Change Resolution button.
To create screenshots of your app from the simulator, choose the Capture screenshot to clipboard button. |
|
To set the location where screenshot are located, choose the Screenshot settings button and choose the location from the shortcut menu. |
Simulate network connection properties
You can help your app’s users manage the cost of metered network connections by maintaining awareness of network connection cost or data plan status changes and enabling your app to use this information to avoid incurring additional costs for roaming or exceeding a specified data transfer limit. The Windows.Networking.Connectivity APIs lets you respond to NetworkStatusChanged and SystemTrigger.TriggerType events that sign. See Quickstart: Managing metered network cost constraints.
To debug or test your network cost-aware code, the simulator can mimic properties of a network that are exposed through the ConnectionProfile object returned by GetInternetConnectionProfile.
To simulate network properties:
On the simulator toolbar, choose Change network properties
On the Set Network Properties dialog box, select Use simulated network properties
Note
Clear the check box to remove the simulation and return to the network properties of the currently connected interface.
Enter a Profile Name for the simulated network. We recommend using a unique name that you can use to identify the simulation in the ProfileName property of the ConnectionProfile object.
Select the NetworkCostType value for the profile from the Network Cost Type list.
From the Data Limit Status Flag list, you can set the ApproachingDataLimit or the OverDataLimit property to true, or you can choose Under Data Limit to set both values to false.
From the Roaming State list, set the Roaming property.
Choose Set Properties to simulate the network properties by triggering a foreground NetworkStatusChanged event and a background SystemTrigger of type NetworkStateChange.
More information about managing network connections
Quickstart: Managing metered network cost constraints
Analyze energy use in Store apps
Windows.Networking.Connectivity
How to respond to system events with background tasks
How to trigger suspend, resume, and background events in Windows Store apps
Navigate the simulator with the keyboard
Navigate the simulator toolbar
Press Ctrl+Alt+Up Arrow to switch focus from the simulator window to the simulator toolbar.
Use the Up Arrow and the Down Arrow to move between toolbar buttons.
Shut down the simulator
Press Ctrl+Alt+F4.