开发者

Win Mobile 5.0 Can't Debug and user WiFi

I have an app that I have to debug. It is C++ on Windows Mobile 5.0, and it uses a network connection via WiFi. (Visual Studio 2008.)

Disconnected from USB and active sync the app connec开发者_如何学Gots to the network just fine, but as soon as I plug it into the cradle, (and consequently connect via ActiveSync) it automatically disables the WiFi network, and I can't seem to find anyway to turn it back on.

I need ActiveSync to control the program in the debugger, and I need WiFi to have the application run, but I seem to only be able to have one or the other.

Does anyone have any ideas? Please save me from having to resort to debugging via printf statements :-)


Don't use ActiveSync - debug directly through the WiFi connection.


I've recently been having reliable fortune debugging over WiFi. The magic seems to be configuring the device's transport IP address and using ActiveSync to jump-start the process.

(I'm using Visual Studio 2008 on a Windows 7 (x64) system; and a Windows Mobile 6.5 device, in case it matters.)

Start up copying the five files listed below unto the mobile device.

  1. Make sure your WiFi is connected and your WM device had a valid IP.
  2. Inside Visual Studio, select Tools .. Options .. Device Tools; then select Devices
  3. Select the "Device" you want to debug; I used "Windows Mobile 6.5.3 Professional Device"
  4. Properties
  5. The Transport should be "TCP Connect Transport", click Configure.
  6. Select "Use a specific IP address" and enter the address.
  7. Exit the dialogs
  8. Connect the WM device via ActiveSync; connect the project to the device within Visual Studio and run it (inside the VS debugger).
  9. Exit the application, waiting to make sure the debugger completes normally.
  10. Disconnect the device from the USB ActiveSync connection.
  11. Run CMAccept (see below) on the mobile device
  12. Run the debugger. (Don't wait to long, because there might a time-window.)

With any luck, the app will start just as if it were still connected to ActiveSync. You can even compile and deploy updated files without needing to reconnect ActiveSync.

First time this worked, I think my jaw hit the ground; I stumbled upon it by chance and simply couldn't believe it was working.

[Debugging on CE5.0 device without ActiveSync] discusses this for Visual Studio 2005 beta2; it seems to be relevant. (This link is also cited in another answer to this question).

The instructions include copying 5 files from host \Program Files\Common Files\Microsoft Shared\CoreCon\1.0\Target\wce400\<CPU> to \windows on the device.

I copied the 5 files from \Program Files (x86)\Common Files\Microsoft Shared\CoreCon\1.0\Target\wce400\armv4 to \VSDebugFiles on my device (expecting to experiment with them). What I did find was that, if Visual Studio refused to connect following the above steps, running CMAccept on the device would help.

In case the link is ever removed, the five files are:

  • clientshutdown.exe
  • CMAccept.exe
  • eDbgTL.dll
  • CommanClient2.exe
  • TcpConnectionA.dll

Ok, I admit that this is still very hit or miss, but it is hitting more often than not.

If you don't have a convenient way to check your device's IP, try VxUtil; it's my go-to network utility for validating Windows Mobile network connections.

Good luck, hope it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜