Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5143084
  • 博文数量: 1696
  • 博客积分: 10870
  • 博客等级: 上将
  • 技术积分: 18357
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-30 15:16
文章分类
文章存档

2017年(1)

2016年(1)

2015年(1)

2013年(1)

2012年(43)

2011年(17)

2010年(828)

2009年(568)

2008年(185)

2007年(51)

分类: 嵌入式

2010-08-18 17:52:44

Application Deployment essentials for VS2005 device application developers - Part III


In this post I am writing about a couple of things that I found greatly useful during deployment and debugging.  In my next post I will discuss why developers needs to be aware of Windows Mobile OS limitations.

1. My device application writes to a log file. To view the log file, copying to desktop every time is a pain.  How can I view log files on desktop without needing to copy? - There is more than one way to view the log files created by a device application

  • View log files directly on the device or emulator - but viewing log files on device or emulator screen is painful and not practical when the log is of modest size
  • Copy the log files to desktop manually over ActiveSync and view it on desktop - but copying every time is a pain

Can we do better than the above two options? Yes, at least when using an emulator.  One of the cool features of device emulator is Folder Sharing, which allows us to mount a desktop folder as "\Storage Card" under the device file system.  Say that we want to map "d:\workspace" folder as storage card under the emulator.  This can be done by selecting "File->Configure..." menu option on the emulator window.  This opens up "Emulator Properties" window.  Edit the text box titled "Shared Folder:" to specify "d:\workspace" as folder to be shared with emulator. Now whatever the files created under "d:\workspace" directory could be viewed under "\Storage Card" device folder and vice versa.  To view log files on desktop without needing to copy, all we have to do is to configure the application to write its log files under "\Storage Card".  It is always a good practice to keep the path of the folder under which log files are created configurable.  This is one example where such a practice pays off.

It should be noted here that Folder Sharing option is not available in case of a physical device.

2. Is it possible to achieve zero deployment time, at least with the emulator? - Let us recollect the fact that, F5 time = build time + connect time + deployment time + debug launch time.  As I mentioned in my first blog post, using emulator Saved State connect time could be drastically reduced.  Using Saved State even deployment of dependent dlls could be avoided.  But every time if we edit source code and press F5, the newly built executable will get deployed.  Making an application executable deployment time to zero makes the total deployment time close to zero.  How can we reduce an application executable deployment time to zero?  The answer is Folder Sharing feature of emulator.  This trick could be achieved by performing the following two steps:

  • Share the desktop folder under which an application executable is built with emulator. By default VS2005 creates projects under "C:\Documents and Settings\\My Documents\Visual Studio 2005\Projects" folder assuming VS2005 is installed under C: drive.  Say the user name is "sivarv" and project name is "MyProject".  The debug version of the managed application executable built is stored under "C:\Documents and Settings\sivarv\My Documents\Visual Studio 2005\Projects\MyProject\MyProject\bin\Debug", which is the folder to be shared with emulator.  In case of native applications the folder path varies slightly as it also targets a specific platform.
  • Set the deployment location of the application on the device to "\Storage Card".  Please read my first blog post to know how to change deployment location.

Subsequent to the above two steps, pressing F5 will not deploy application executable as it is already deployed at the target location on emulator through folder sharing!


阅读(673) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~