The Media Transfer Protocol Device Simulator (MTP Simulator) is a fully-featured, self-contained device simulator that emulates an MTP device. Its primary purpose is to enable developers to exercise expected behavior based on the MTP specification by returning appropriate MTP response packets and generating MTP events. The tool’s graphical user interface (GUI) enables easy configuration of MTP parameters and presents MTP traffic and data in a friendly, human-readable format.
The MTP Simulator implements all MTP device capabilities, object properties, and operations that are based on the MTP Specification along with the major features in Windows 7. Additionally, the MTP Simulator also supports Device Stage and loading customizable device profiles.
For transport support, the MTP Simulator runs on multiple transport options such as USB, Software-Simulated USB (SoftSim), Bluetooth, and IP. Last, but not the least, the MTP Simulator runs on both Windows Vista and Windows 7.
The MTP Simulator is publicly available as part of the Windows 7 Portable Device Enabling Kit for MTP (DEK). The kit also includes support documentation for the MTP Simulator and the MTP Specification Version 1.0 and MTP Device Services for Windows. Included in the DEK is the MTP Device Simulator User Guide which provides a detailed description of the MTP Simulator.
The MTP Device Simulator is installed as part of the Windows 7 Portable Device Enabling Kit for MTP (DEK). Before running the simulator for the first time, you may need to install the Device Simulation Framework (DSF).
To install DSF:
Once DSF is installed, you can launch the MTP Simulator from C:\WindowsDEK\Tools\MTP Device Simulator\MTPSimUI.exe. Select your desired transport, and click “Connect” to launch an instance of the MTP Simulator. The next section gives an overview of the User Interface.
The following screenshot shows the MTP Simulator UI with navigation buttons and configuration options.
Left control tabs and menu options.
Connect, disconnect, or restart MTP Simulator by using the currently selected configuration. You can change the transport type on the Transport tab and change the test mode on the Device Mode tab.
Select the transport to be used. To simulate a software-only USB device, select the “SoftUSB” transport.
Normal Mode should be used. Test Mode is reserved for internal Microsoft testing.
Lower-right output window.
This window displays redirected output from stdout. Any output from a printf statement, such as trace—from either MTP Simulator or a plug-in—appears in this window. The output is also saved as mtpsimui.log automatically under the MTP Simulator root directory.
In addition to the GUI, you can control MTP Simulator at startup by using command-line parameters. This can be useful when you need to perform automated testing. For details, see Appendix C from the MTP Device Simulator User Guide.
You can control the capabilities that the MTP Simulator reports to Windows by using an XML file (see Appendix F in the MTP Device Simulator User Guide for details). Device capabilities are controlled by DeviceSummary.xml, and service capabilities are controlled by Services.xml.
The DeviceSummary.xml file enables you to customize the contents of the DeviceInfo, StorageInfo, DevicePropDesc, and ObjectPropDesc datasets.
The Services.xml file enables you to specify configurations that are related to device services, including service-supported formats, methods, and events.
The MTP Simulator also supports loading different device profiles. A device profile contains a set of customized configuration files (i.e. DeviceSummary.xml and Services.xml) describing a sample device. The DEK comes bundled with sample profiles representing each device class (Camera, Cellular Phone, Media Player, etc). Details of how to load the device profiles are outlined in the MTP Device Simulator User Guide.
Simulates a sample camera.
Simulates a cellular phone.
Simulates a portable media player.
Simulates a device that supports the Full Enumeration synchronization model, for example for contacts, calendar, tasks, and notes synchronization.
Simulates a device that supports the Full Enumeration synchronization model (like MtpSim-FullEnumSync), with additional support for the simple participant feature.
Each of these profiles has a corresponding Device Stage package. Each of these packages supports the same set of standard Device Stage tasks, with the exception of the Ringtone task which is not supported by the Fabrikam_Camera and Fabrikam_PMP profiles. For more information on authoring Device Stage metadata, refer to the Windows 7 Device Stage Development Guide in the Microsoft Device Experience Development Kit.
The MTP Simulator can also be used to test custom Device Stage packages. The MTP Device Inspector tool can be used to generate a device profile which can be loaded into the Simulator (see the MTP Device Simulator User Guide for details). Once a custom Device Stage metadata package has been authored, the package contains all the files necessary to display a Device Stage experience in Windows 7. The package may be tested by copying it to the PC’s device metadata store and connecting the test device, in this case rapid development can be done using the MTP Simulator. In order to load (unsigned) custom Device Stage metadata the system will need to be boot into test mode. For more details, refer to page 40 of the Windows 7 Device Stage Development Guide document that is included in the Microsoft Device Experience Development Kit for details on testing Device Stage metadata packages.
The MTP Device Simulator User Guide in the Documentation for the Device Enabling Kit contains more information on the features described above.
If you have general questions about the MTP Simulator contact AskMTP at Microsoft dot com.
This posting is provided "AS IS" with no warranties and confers no rights.