Launch Windows Phone 8 Emulator without launching Visual Studio 2012

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:

  1. 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
  2. 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:
    Hyper-V Feature
  3. 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:
    Cmd
  4. 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”:
    XDE
  5. 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:
    XDE Hyper-V error
  6. This will now launch the windows phone 8 emulator for you:
    Windows Phone 8.0 Emulator
  7. 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… 🙂

Advertisement
This entry was posted in How To, Visual Studio 2012, Windows Phone 8 and tagged , , , , . Bookmark the permalink.

27 Responses to Launch Windows Phone 8 Emulator without launching Visual Studio 2012

  1. sitaram says:

    First of all thanks for the post , i have a doubt , If i am using vs2012 , if i run the application it will be deploying the application in the emulator it will be deploying the app in emulator , but if i am opening the emulator without vs2012 , how can i deploy the app into my emultor (will it automatically show up the app in the emulator ( any deplotment tools are there etc..or any other process) ??? ,

    • Thanks for appreciating Sitaram. One of the things that the emulator will do before shutting down is to store the state in the VHD. So once you deploy the app to the emulator using Visual Studio and properly shut it down without uninstalling the app from the phone, you should see it on the phone the next time you turn on the emulator, even if it’s without using Visual Studio. Hope that answers your question.
      Thanks!

      • sitaram says:

        you what you telling about is opening app atleast one time (first time ) in vs 2012 , and then after that opening the app in emultor itself without opening the vs2012 right ? , correct me if i am wrong . but i am talking about a scenario where i dont have vs2012 installed in my windows 8 machine itself , and trying to open or deploy the app in emulator, directly . is it possible to do that ??

      • Hello Sitaram,
        Yes, you are correct about my suggestion. Regarding deploying the app without using Visual Studio: Unfortunately, I am not an expert on mobile development but based on whatever experience I have in trying to setup demonstration environments for SharePoint, I’d say you will need Visual Studio to deploy it at least once. The other way will be to publish your app to the app store and install it from there, although, that would assume that you have already tested it somewhere else (so I am not sure what use will it be for you to deploy it to the emulator again). Out of curiosity, what tool are you using to build the app? You should ideally be able to use the same tool to deploy as well.
        Thanks

  2. sitaram says:

    i use vs2012 itself for building and deploying the app in emulator , however there is application deployment tool also provided by vs2012 to deply app into emulator .

    • ok… so I reached out to a mobile dev expert in my organization (Geoff, my thanks to you if you are reading this 🙂 ). Here’s what he had to say:
      There are powershell commands you can run to side-load a packaged application for testing purposes onto a device (I suppose it might work on the emulator as well).
      You’ll still need to package the application in visual studio. You’ll also need powershell on the emulator. Here’s an article that discusses how to do this on a Surface RT:
      http://www.lhotka.net/weblog/TestingAWinRTAppOnASurfaceRT.aspx
      HTH!

  3. Abhishek says:

    hi
    i was having one issue with WP8 emulator wvga 512mb
    unable to start inter

    if u have any idea please help

    Thank you

    • Hello Abhishek,

      Could you please elaborate? Are you saying the emulator starts but the phone is not able to connect to the internet?
      Thanks

      • abhishek says:

        hi Gaurav,

        i was done with the internet connection with my emulator,

        still i was having some of the doubts with emulator,
        i have created one application which send some of the photographs to face book [here i want to point out one thing Microsoft soft does’t provide email client that really very funny hahaha as i want to send photos to or as a emails ]
        strange is when try to connect with facebook[i have created one app in FB and pass token for that] connection goes out give me error internet connectionis not available .
        but when try to open facebook directly from browser Internet working fine

        any idea

        Abhishek
        (neosoft)

      • Hello Abhishek,
        Sorry for not being able to reply sooner. Not sure if you have already resolved the problem but thought will mention my thoughts nonetheless. The main thing to note is that even though you are connecting form within the emulator, it is still using the internet connection of your host. A few things you will want to check will be: Is your host located inside a proxy? Are there any firewall rules configured for the host?
        Please do let me know if any of the above pointers worked or if the issue is already resolved!
        Thanks!

  4. Abhishek says:

    hi Gaurav
    Thanks for the replay.
    1st that issue is still there not yet resolved .

    the main thing that i let you know is we or any body who is using Emulator. his/her emulator must configured with dynamic IP so Proxy are not a part of picture right.

    and if firewall break something than why it’s working on mobile inbuilt browser? might be it’s an issue of emulator

    • Hi Abhishek
      Sorry again for not being able to reply any sooner. The emulater is a guest OS running on a host operating system and ultimately utilizes the netwrork settings of the host. I am talking about the firewall/ proxy settings and rules on the host. Since your request through the browser is going fine, I am just assuming that your app is somehow not going past the proxy/ firewall. The best way to rule this out is to try running the emulator through an internet connection that does not need a proxy and possibly temporarily disable the firewall as well.
      Please let me know if you have already solved the issue or if you are able to run the above tests
      Thanks!

      • Abhishek says:

        hi gaurav
        i have already tried every possible trys but still not working.

        thnks for your support

        abhishek goletar(solusoft technologies)

      • Sorry to hear.. the only other way I can help troubleshoot is if you can somehow upload the VM on a skydrive/ ftp or somewhere else and send me details on the app….
        Thanks

  5. Oliver says:

    Hi, thank you for your tutorials. I tried the one without installing VS2012 and Installation seemed to work fine so far, all folders and files are created.
    However when I try to launch the emulator always only the help file pops up like the one when typing xde /?

    I installed in C: and I tried your command:
    C:\Program Files (x86)\Microsoft XDE\8.0>xde -vhd “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.vhd

    the help popup says /vhd needs to be used instead of -vhd so I also tried this one:
    C:\Program Files (x86)\Microsoft XDE\8.0>xde /vhd “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.vhd”

    same result. I can see the Flash.vhd in the corresponding folder though.

    Any suggestions?

  6. Pingback: Windows Phone 8 Emulator for Exchange 2013 Testing | Cavarpe Technology Blog

  7. Dick says:

    I had the same problem as Oliver. I directly pasted the above first time XDE call but after that it only produced the paramater help window. Also after restarting the PC and several adaptions like /vhd (as it said in the paramaters). Finally managed to get it running after entering the command as follows:
    “C:\Program Files (x86)\Microsoft XDE\8.0\XDE.exe” -vhd “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.vhd”

    and it worked. Not sure if this was coincidence, or the quotes (including the path) between the exe call; it shouldn’t be…
    It’s a shame that Microsoft doesn’t have this done in the installer; I didn’t have to do that with the Phone 7 SDK & VS 2010 on my previous PC.

    But anyway: thanks a lot for your article, this helped!

    Dick

  8. harishchsm says:

    Hi Gaurav!

    Thanks for your article. Due to some problem with my OS, I happened to re-install it fresh along with every tools. I’m using Windows 8.1(64-bit), VS 2012, Emulator 8.0 for developing applications. I tried to build and deploy my app with the emulator. But it failed to launch. Then I searched for solution and then I came here. I did first 3 steps successfully, but in the 4 step, the emulator did not launched. I have tried more no. of times. But it didn’t, I hope you will have solution for this.

    • Harish says:

      Oh just discard it, because I solved it! 🙂 I just installed the visual studio update 4 and then every thing just worked fine. Anyway thanks a lot Gaurav.

      • Thanks Harish! Thank you for stopping by and for your comments. Sorry I could not respond in time. I am posting your comments here for others benefits as well!
        Thanks again!

  9. chinna says:

    can Any one can solve me the problem,i have the done the above the commands,it hits error like this cannot start the window phone emulator. the windows phone emulator requires Hyper V.your pc is missing the prerequisites is required to run the Hyper v.

    I dont have my pc slat requirements and hyper v..

    can anyone knew to solve this.

    China

  10. Pratik says:

    Following this process after executing the command, I got the POPUP as windows has some compatibility issues. I continued anyway but after that Emulator didnt launch. Neither or nor any exception or error is shown. Any suggestion?

    • Hi Pratik
      This was implemented way back in Windows 7 or WIndows 8. What Windows version are you on? What emulator are you trying to use and on what version of VS 2012. The versions of these different software might be leading to compatibility issues.It will also help to look at any errors reported in the windows event logs
      Thanks!

Leave a Reply to Oliver Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s