none
how to create a start screen tile for the windows phone 8 emulator

    Question

  • With the 7.1 developer tools on Win7, Start Menu items were created for me to run the Windows Phone emulator manually.  I want to do this to use the web browser in there for testing web stuff.  This didn't require me to build/run apps from Visual Studio.

    On the new Windows 8 with VS 2012 installed, no tiles were created on the Start screen for the emulator.  I can run it by building an app and running it, and then closing the app, but this is slow and clunky -- I just want the emulator running to use IE, so I want to start the emulator directly.

    Is there a way to create a tile on the home screen that runs the emulator?

    Thursday, November 01, 2012 8:02 PM

All replies

  • Hi,

    You could create a tile that does this, but when developing I usually switch to the Desktop (by touching the <window> key on the keyboard), and work from there.

    Here is a procedure for launching the emulator (XDE) manually, by copying the currently chosen emulator (flash.vhd) to a new location and then launching it. Copying it will effectively decouple it from further Visual Studio manipulation which enables the emulator to retain all settings and states, instead of implementing the default mechanism which causes emulator state to be reset each time it is launched.

    Steps:

    • Copy the Flash.vhd file from the "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images" folder to another location (example: C:\WP8\Images)
    • Open an elevated command prompt. Use the following command line to make XDE create and boot a new Hyper-V VM named WP8-SDK:
      "C:\Program Files (x86)\Microsoft XDE\8.0\xde.exe" /vhd "C:\WP8\Images\Flash.vhd" /name WP8-SDK
    • Now you can change, for example, settings like language+region or add an Exchange ActiveSync partnership.
    • The changes will be persisted to the Flash.vhd virtual disk and although the VM shuts down when you close the XDE window the changes are picked up when you boot the VM again if you use the same XDE command line as before.

    You can create a script file (e.g at C:\WP8\WP8_XDE.CMD) containing the above script and copy the file onto your Desktop.

    If you want it to appear as a Windows 8 Tile, you can create a tile that is a shortcut to your CMD file:

    1. From Explorer, right click on WP8_XDE.CMD and choose Create Shortcut.
    2. Copy the shortcut to this specific folder:
      C:\ProgramData\Microsoft\Windows\Start Menu\Programs
    3. Use Metro Search to find your shortcut (switch to the Metro screen and start typing the name of your file)
    4. Right click the found file, and choose 'Pin to Start', just as you would an App.

    Hope this helps,
    Mark


    Mark Chamberlain Sr. Escalation Engineer | Microsoft Developer Support | Windows Phone 7



    Friday, November 02, 2012 2:31 PM
  • Is there any way to get the debugger to connect to this instance of the emulator that's been pinned.

    I was able to run the emulator this way, but couldn't actually launch from VS2012.


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Thursday, November 08, 2012 4:05 PM
  • This gets more and more interesting.

    I looked at the task manager to see what it's command line was when it unsuccessfully launched the emulator.

    I then duplicated that into a cmd file and launched.

    To my surprise, it seems to have actually launched the emulator, and more interestingly, the Flash.480x800.vhd file located in %PROGRAMFILES%\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images seems to be growing now, and has a changed date, where before it was stuck at it's original installed size of 39,278 KB.

    So it now looks as though there's some permission problem with the install.

    Connecting to the emulator after it's running in this fashion, now allows me to deploy the application, and more importantly, debug it too.

    Can you get me a free surface/Lumia for spending all this time trying to figure this out, saving MS money?


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Thursday, November 08, 2012 5:22 PM
  • I haven't investigated whether this is possible but I can see the benefits of being able to retain emulator state. There might be a technical reason why state isn't retained by default.

    VS apparently launches the emulator via a Hyper-V interface. The base VM images are found at C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images.

    [EDIT]:

    Thanks Anthony, I will endeavor to find out what the Dev team may have to say about this.

    -Mark


    Mark Chamberlain Sr. Escalation Engineer | Microsoft Developer Support | Windows Phone 7


    Thursday, November 08, 2012 5:37 PM
  • Anthony, I have some info and a query from an internal developer.

    The WP8 emulator requires Admin permissions when launched the first time, and Hyper-V admin privileges every time it is launched after that, however when launched if you don’t have Hyper-V admin privileges it should ask for elevation and add the current user to Hyper-v admin group.

    Did you ever get that message? If that was not happening automatically we would be interested to know what error messages you may have been hitting, along with what groups your user account is part of, and also would like to know if your machine is joined to a domain.

    In User Accounts, are you a member of Hyper-V admins (as well as Administrator)?

    Thanks!
    Mark


    Mark Chamberlain Sr. Escalation Engineer | Microsoft Developer Support | Windows Phone 7


    Thursday, November 08, 2012 7:17 PM
  • I was running on an admin account, but I have a desktop machine that's faster that this all works on, so I compared the two machines.

    My method above worked, but didn't create a differencing disk, thereby modifying the 480x800.vhd

    On the faster machine this wasn't the case, so I've reverted to the unmodified disk and tried again.

    I also changed UAC to always prompt on this machine so I can see further what's going on, and changed my account to a limited user.

    I then deleted the %APPDATA%/../local/Microsoft/XDE settings and ran the emulator again.

    It prompted for add to HYPER-V, and I elevated the command, but it does ask for being added to HYPER-V every time.

    Now this 480x800 512 machine eventually started, though it said it couldn't get access to all features.

    Running that VM a second time seemed to work normally, though it still asks for elevation to join the HYPER-V group every time.

    I'm beginning to wonder if there's a timeout in XDE, as this 512K VM now appears to run every time. The 1024 K one won't start however.

    It keeps shrinking dd.480x800.1024.vhd in %APPDATA%\..\Local\Microsoft\XDE

    Also, when I run "control userpasswords2" and go to the advanced tab, and view the groups, there doesn't appear to be a HYPER-V group.  Where am I supposed to be looking?


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Friday, November 09, 2012 8:32 AM
  • Hmm.  Found azman.msc as a way to manage the admins.

    Interestingly, there was an unknown user in there (I added myself to my machine with a live id first, and ended up with a horrible name in c:\users\supp0000 or something, so deleted the user account).

    I then manually added my current user account to the administrators, and now the Hyper-V warning has disappeared.

    I also tried starting the failed emulator images using

    XDE.exe /name "Emulator WXGA.tony" which is the name of the machine in the hyper-v manager

    That took a very long time to start, but eventually did.  Unfortunately, when I relaunched it from VS Express, it overwrote the VHD that was created when launched from the command line.

    The other thing I notice is that there is a snapshot .avhd file created for the one VM I've managed to get working.


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Friday, November 09, 2012 9:12 AM
  • To see the Hyper-V Administrators group, you can run lusrmgr.msc.

    I will pass this info back and check for feedback.

    Thanks,
    Mark


    Mark Chamberlain Sr. Escalation Engineer | Microsoft Developer Support | Windows Phone 7

    Friday, November 09, 2012 5:48 PM
  • There is no Hyper-V administrators group listed.

    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Saturday, November 10, 2012 9:47 AM
  • @ChristoWin8 - I believe your intent is to have an easy mechanism to launch WP8 emulator without going through the hassle of opening VS and creating new project.

    Mark mentioned one way of acheiving this.

    An alternative to this method is to use "Application Deployment" tool. You can find it through Win8 Search charm.

    Below are the steps that you can follow -

    • Create a small Phone project and store it's XAP at some known place (to be done only the first time)
    • Launch "Application Deployment" from Search charm
    • Select appropriate Target emulator
    • Browse to the XAP created earlier
    • Launch

    Benefit that I can see in this approach - "Application deployment" tool is a really light-weight process. It provides alternative of launch all kind of WP8/WP7 emulators. Emulators launched throuh process should work with VS as well.


    Saturday, November 10, 2012 2:01 PM
  • Thanks for the tip.  I've just got back to WP8 dev, and was hoping to test 720p, so I don't have to buy a device.

    Unfortunately, I'm still finding it impossible to start the emulator on my PC.

    My disk drive does run slow and occasionally makes a loud click, so I wonder still if there's some timeout.  SMART, etc show that it's ok, as do disk diagnostics though.

    Using the tool described above I get error 0x89731812


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Thursday, May 23, 2013 3:20 PM
  • Hi Antony,

    FYI That error code indicates the tool failed to find the port associated with the target device; suggesting it isn't installed.

    -Mark


    Getting Started? Click here
    Blog: Windows Store & Phone Developer Solutions

    Thursday, May 23, 2013 3:42 PM
  • In the end, I followed the instructions at the top, but created my own differencing disk (WP8-720.vhd) of the correct screen res in a different folder.  I then started the xde command line again on the differencing disk, which finished the setup.

    I then copied that differencing disk to

    %PROGRAMDATA%

    I then copied that file (WP8-720.vhd) across to the protected OS directory
    c:\program files (x86)\Microsoft SDKs\WIndows Phone\v8.0\Emulation\Images

    I then renamed the old Flash.720x1280.vhd file to Flash.720x1280-orig.vhd

    I then renamed my new file to Flash.720x1280.vhd

    Now the emulator starts from VS2012.

    If it's a timeout, someone really ought to update VS2012/XDE to allow us to override it at least via the registry (or publish how to do it).

    I've lost days of work since I started on WP8 dev on this.


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Thursday, May 23, 2013 5:19 PM