分类: 嵌入式
2010-08-18 17:52:44
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
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:
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!