One of a recent pre-sales engagements that I was working on required me to demo the BI capabilities of SharePoint 2010 on a Windows 8 phone device. Considering that it needed to be projected for the benefit of the audience and the fact that the demo SharePoint environment was not exposed to the internet and therefore could not be accessed from a mobile device, I decided to perform the demo using a Windows Phone 8.0 Emulator.
The Windows Phone 8.0 emulator is essentially a virtual hard drive (VHD) that is launched using Hyper-V (cool :)). So here’s what you need to do to be able to launch the Windows Phone 8 emulator without having to launching Visual Studio:
- Ensure that you have downloaded and installed the latest version of Windows Phone 8.0 SDK from here (at the time of writing the blog): http://www.microsoft.com/en-us/download/details.aspx?id=35471
- Ensure that you have the Hyper-V feature installed on your Windows 8 machine. You can do this by browsing to Add or remove programs –> Turn Windows features on or off –> Selecting Hyper-V from the pop-up screen:
- Open the command prompt in elevated mode and change the current directory in the command prompt to: “C:\Program Files (x86)\Microsoft XDE\8.0” (assuming you have installed the SDK to the C:\ drive). Alternately, you can browse to this folder in Windows Explorer, press the “Shift” key, right click the folder and then select “Open command window here” to directly open the folder in command prompt:
- If you are launching the emulator for the first time, you will need to provide the path to the virtual hard drive to be used by it. The Windows Phone SDK installer installs the windows phone 8.0 VHDs in the “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images” folder(again, assuming you have installed the SDK to the C:\ drive). We are going to launch the “Flash.vhd” hard drive from this folder. To do so, we will run the following command from the command prompt opened in the above step:
xde -vhd “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.vhd”:
- When the emulator launches for the first time, it tries to configure the Hyper-V network settings (adds and configures new network adapters to your machine so the phone is connected to your network and consequently the internet). If you did not launch the command prompt in step 3 above in elevated mode, you will receive the prompt shown in the image below. This is absolutely normal. If this happens, click the “Retry” button and XDE.exe will automatically launch with elevated privileges. Remember that the emulator only needs to run in elevated mode the first time. So if you shut down the phone and start it again, you will not need to launch it in elevated mode:
- This will now launch the windows phone 8 emulator for you:
- After the first time of launching it, XDE will remember the path to the vhd file. So if you shut down the phone and would like to launch it again, you will only need to double click the XDE.exe file to launch it again. I’d recommend creating a shortcut for it on the desktop or another convenient location.
The following link provides some nice troubleshooting tips in case you face issues running the emulator: http://social.msdn.microsoft.com/Forums/en-US/wptools/thread/b06cc9f2-aa5e-4cb3-9df1-0c273e1dfd68
I will also shortly blog about installing the Windows Phone 8.0 emulator without having to install Visual Studio 2012. Hope you have fun with you new phone… 🙂