Here is the follow-up installment #2 on device emulator configuration. You may want to read installment #1 first.
I often need to test our code across various versions and SKUs of Windows Mobile. For instance, I need to test one feature across WM 5.0 Smartphone, WM 5.0 Pocket PC Phone Edition, WM 6.0 Standard, WM 6.0 Professional and, of course, the newer WM 6.1 SKUs.
When testing, you often want to use a hard/cold booted device for the most reproducible results. Cold booting and then reconfiguring a bunch of devices is super time consuming. Even if using the device emulator, configuration can be time consuming.
Another important issue is network availability. Much of my testing requires a network connection for client/server applications. I used to connect my emulators using Desktop Passthrough via Desktop ActiveSync or Windows Mobile Device Center on Vista. This setup invariably led to the following problems:
These issues can be solved by utilizing the built-in NE2000 NDIS network adapter that comes with the device emulator. Here is a set of steps that I use for setup. After you finish setup, you can save the device emulator state and when attempting a new test case, you simply close and re-open the emulator for full cold boot with configuration intact.
Here is how I go about configuring the emulator to meet my testing requirements.
First, if you’ve ever saved state on the device emulator image before, right-click the image in the Device Emulator Manager and choose “clear save state”. This provides a true default, factory-reset image as your starting point. There is an option in the emulator’s file menu for cold reset, but it does not take the device back to a truly “clean” state.
Next, in the Device Emulator window, open the File menu and select “configure”.
In the “General” tab, you can configure a “Shared Folder”. I like to share a folder located on my desktop to the device emulator by configuring the “shared folder” setting. Once configured, you can open desktop files in the emulator by browsing the “storage card” volume in file explorer on the device emulator. If using multiple emulators, you can set them to all use the same shared folder. This allows you to copy files into the desktop folder and then open the identical file on all emulators. For instance, you could copy CAB Provisioning Files (.CPF) to the desktop shared folder and execute them from the device emulator’s file explorer to easily configure the device.
In the “Network” tab, you can setup your emulated NE2000 adapter. Just select the checkbox for “Enable NE2000 PCMCIA network adapter and bind to:” and select “Connected Network Card”. The NE2000 will bind to the first network adapter it finds on the desktop computer after you click OK on the “Emulator Properties” checkbox.
You may find that you still can’t connect to known servers using the device emulator’s Mobile IE browser. That is likely due to work/internet settings. Here is what you do:
At this point, you may want to configure some of the following:
After you’ve finished creating your base image configuration, click the “File” menu in the device emulator windows and select “Save State and Exit”. After the save process is finished, reopen the same emulator image and you’ll find that its configured and ready for your first test case! After you’ve completed a test case, close the emulator, but do NOT save the emulator image or it will overwrite your carefully created image. Re-open the image and you’ll find that you are right back to your base image configuration and ready for your next test case.
If you are using multiple device emulator instances to test a client/server application, you can have them all open and connected at once to run the test case simultaneously.
If you choose to use activesync, then use it after you’ve created and saved your base image, if possible.
Hope this helps!
Dave Field, CISSP, MCP
Device Management and Security Architect
Enterprise Mobile, Inc.