Command Line Debugging Revisited – Part 2: The Device Emulator

The Visual Studio 2005 Device Emulator is a very cool tool for developing, testing and debugging Windows Mobile applications.  You can design for and run on the wide variety of Windows Mobile devices.  In addition, you can install and use the localized images, to run your applications on international versions of the Windows Mobile operating system.

By default, the Device Emulator uses DMA as it's transport for device to desktop communications.  The MDbg command line debugger supports TCP/IP for device to desktop communications.  To allow MDbg to be used with the Device Emulator, there are some additional steps that are required before a connection can be established.

Abhi Khune has an excellent post on establishing a connection to the Internet using the Device Emulator.  In that post, there is a paragraph talking about the DMA and TCP/IP transports where it is noted that changing the Device Emulator transport from DMA to TCP/IP is not recommended.  I fully agree with the recommendation with one notable exception: it is the only means to connect MDbg to the device emulator using the .NET Compact Framework version 2 service pack 1 debugger extension (mdbgnetcf).

Note: After changing the Device Emulator's transport, you will need to reset the device.

Recommendation: I highly recommend switching the Device Emulator transport back to DMA once you are finished debugging with MDbg.

Once the Device Emulator is configured for the TCP/IP transport, there are two options for connectivity.

  1. ActiveSync
    For me, the easiest way to establish a TCP/IP connection using the Device Emulator is to use Visual Studio 2005's Device Emulator Manager and ActiveSync to "cradle" the device.

    Abhi's post provides a walk-through on using the Device Emulator Manager, with many screen shots.
  2. Virtual Machine Network Driver
    Another alternative is installing the Virtual Machine Network Driver.  You can download and read installation instructions in the Microsoft Download Center.

    When using the Virtual Machine Network Driver, there is no need to cradle the Device Emulator using ActiveSync and the Device Emulator Manager.

Please note you will need to perform Abhi's steps once per Device Emulator image (ex: Windows Mobile 5.0 Pocket PC) you wish to use with MDbg.

With the above steps completed, you can connect and debug with MDbg as described in part 1.

-- DK

[Edit: fix spelling error]

Disclaimer(s): This posting is provided "AS IS" with no warranties, and confers no rights.

Comments (3)

  1. David Kline says:

    In the previous parts of this series, I talked about getting started with MDbg and using the Device Emulator. …

  2. By default, the Device Emulator uses DMA as it’s transport for device to desktop communications. The…

  3. David Kline says:

    Dan Elliott recently posted about the IL OpCodes supported by the .NET Compact Framework.  This…

Skip to main content