如何使用命令行重建.net CF应用程序并在Windows Mobile模拟器中部署

发布于 2024-09-14 00:54:08 字数 314 浏览 2 评论 0 原文

有没有办法重建 ac# .net CF 应用程序并从命令行将其部署在 Windows Mobile 模拟器中?

这是创建自动化bat 文件所必需的。

我查看了 http://msdn.microsoft。 com/en-us/library/aa188169(VS.90).aspx 其中提到了如何从命令行使用模拟器,但没有提到如何在其中部署应用程序。

谢谢,

维琪

Is there a ways to rebuild a c# .net CF application and deploy it in windows mobile emulator from the command-line?

This is required to create a bat file for automation.

I have taken a look at http://msdn.microsoft.com/en-us/library/aa188169(VS.90).aspx which mentions how to use the emulator from command line, but doesn't mention how to deploy an application in it.

Thanks,

Vicky

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

指尖上得阳光 2024-09-21 00:54:08

我刚刚尝试使用 /deploy 开关调用 devenv< /a> 告诉它部署到目标,它工作得很好:

devenv /deploy Release "MySolutionName.sln"

I just tried calling devenv with the /deploy switch to tell it to deploy to the target and it worked just fine:

devenv /deploy Release "MySolutionName.sln"

猫弦 2024-09-21 00:54:08

涉及两个步骤:

  1. 使用设备仿真器管理器 (DEM) API 启动仿真器
  2. 使用 RAPI 或 RAPI2 远程执行目标应用程序

1. 使用设备仿真器管理器 API 启动仿真器

要以编程方式启动仿真器,您需要使用设备仿真器管理器 (DEM) COM API。要从 .NET 执行此操作,您需要使用 Microsoft.DeviceEmulatorManager.Interop.9.0.dll 主互操作程序集,应在此处找到它(假设您的操作系统是 64 位):
C:\Program Files (x86)\Microsoft Device Emulator\1.0

虽然您可以直接使用提供的 PIA,但从自定义外观访问 DEM API 要容易得多;幸运的是,已经编写了一个很好的包装器,并且可以从 MSDN 获取,以及一些有关 API 的重要信息:
如何:通过 .NET 以编程方式控制 Windows Mobile 设备模拟器 - MSDN

注意:必须“对接”模拟设备,然后才能使用远程 API - 不要忘记此步骤!

DEM 文档:

2. 使用 RAPI 或 RAPI2 远程执行目标应用程序

一旦您保证模拟器正在运行并“停靠”,您就可以继续通过远程 API (RAPI) 与其进行交互,从而将编译后的可执行文件上传到设备并远程执行它。以下是 RAPI 使用的一些示例:

RAPI 文档:

结论

这应该给出您拥有拼凑一个简单的 CLI 应用程序所需的一切,以便以编程方式在给定的模拟器上启动给定的应用程序。如果您有任何疑问,请发表评论。

There are two steps involved:

  1. Start the emulator using the Device Emulator Manager (DEM) API
  2. Execute the target app remotely using RAPI or RAPI2

1. Start the emulator using the Device Emulator Manager API

To programmatically start your emulator you'll need to utilize the Device Emulator Manager (DEM) COM API. To do so from .NET, you'll want to use the Microsoft.DeviceEmulatorManager.Interop.9.0.dll Primary Interop Assembly, which should be found here (assuming your OS is 64 bit):
C:\Program Files (x86)\Microsoft Device Emulator\1.0

While you can use the provided PIA directly, it's much easier to access the DEM API from a custom façade; fortunately, a nice wrapper has already been written and is available from MSDN, along with some great info regarding the API:
How To: Programmatically Control the Windows Mobile Device Emulators from .NET - MSDN

Note: You must "dock" the emulated device before you can use the Remote API - don't forget this step!

DEM documentation:

2. Execute the target app remotely using RAPI or RAPI2

Once you've guaranteed that your emulator is both running and "docked", you can proceed to interact with it via the Remote API (RAPI), allowing you to upload your compiled executable to the device and execute it remotely. Here are a few examples of RAPI use:

RAPI Documentation:

Conclusion

This should give you everything you need to piece together a simple CLI app to programmatically launch a given app on a given emulator. Please leave a comment if you have any questions.

酒浓于脸红 2024-09-21 00:54:08

有关从命令行部署到模拟器的信息,请参阅 http://sevaa.home.sprynet.com/cedeploy /

For deployment to the emulator from the command line, see http://sevaa.home.sprynet.com/cedeploy/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文