« I was so close to like Windows 8... so close! | Main | Why is the cloud so confusing? »

November 06, 2012

Windows Phone 8 Development on Mac - All the Gotchas

After failing with my attempts to kickstart my Windows 8 development I decided to give Windows Phone 8 a try. Creating Windows 8 Developer account was straight forward compared to the Windows 8 experience however setting up the development environment on my Mac turned out to be painful. I will save you all the steps, which involved reinstalling Mountain Lion, setting up Bootcamp partition, installing Parallels etc. and resulted in few dosens screenshots with errors and exceptions in Visual Studio. Let's get straight to the point.

Is your machine ready for Windows Phone 8 development?

First of all, if you want to do Windows Phone 8 development (the same is true for Windows 8 development), you need a Windows 8 machine. In all fairness this is no different than iOS development... however there are the gotchas below :)

One of the most important things that you need when you do device development is the Emulator. If you don't want to spend all your money buying every possible Windows Phone the Emulator will be your solution for testing. Now, the problem with Windows 8 Phone development is that the Emulator uses the Hypervisor build into Windows 8. However in order to run Windows 8 Hypervisor your development machine (actually the CPU in your machine) needs to support SLAT. If you need more details you can go check Wikipedia's article about SLAT but briefly it is a new virtualization technology available in the modern CPUs.

Here are the official requirements for Windows Phone 8 SDK posted by Microsoft.

If you are like me and you bought your Mac awhile ago it may not be equipped with a "modern" CPU. Here are the steps you can use to check whether you will be able to run Windows Phone 8 Emulator on your Mac:

  1. Install Windows on your Mac
    If you have Windows already running on it it is fine. Doesn't need to be Windows 8, Windows 7 will work just fine. You can use Parallels or Bootcamp or whatever else you want. The sole purpose of this step is to have a way to run the program from Step #2.
  2. Download Coreinfo
    Coreinfo is a small program written by Mark Russinovich that checks low level hardware components.
  3. Run Coreinfo and check the output
    Here is the interesting part. If you have older Intel based Mac (or Macbook Pro like me) your machine may be equipped with Core 2 Duo processor that doesn't support SLAT. General rule is that Intel i-processors support SLAT while everything before that doesn't. Wikipedia has a good list of all Mac models and their CPUs.

For me here is how the output from Coreinfo looked:

CoreInfo

I have Core2 Duo P8600 and although it supports hardware virtualization I wasn't able to run Windows Phone 8 Emulator (as well as the Hyper-V in Windows 8). Interesting though Windows 8 Simulator runs fine although I thought is is based on the Hyper-V too. The best I managed to achieve was the following:

Win8Phone Designer Issue

Interestingly before upgrading from Lion to Mountain Lion I was able to at least see the designer working. Now this is gone though.

Should you use Parallels or Bootcamp?

If your Mac passed the CPU test the answer on this question is quite simple - you must use Bootcamp (or at least for now).The reason is that Microsoft Hyper-V doesn't run in virtualized environment hence your only option is to have Windows 8 installed on a separate partition using Bootcamp.

My personal opinion is that the approach Microsoft took (again) will prevent some of the potential developers to start development for Windows Phone 8 (and Windows 8) as you can see from the following articles and blog posts:
Developers praise Windows Phone 8 SDK, but virtualization and upgrades rankle
Windows Phone 8 SDK what a Big Time Flop
http://forum.parallels.com/printthread.php?t=264863
Windows Phone 8 Emulator on MacBook Pro – No SLAT

There are two articles that I found explaining how you can use VMWare Fusion to run Windows 8 on your Mac. I doubt it will be successful if your machine doesn't have SLAT support but maybe it is worth looking into them:

http://blog.brightpointuk.co.uk/running-windows-phone-8-emulator-mac-os
http://www.developer.nokia.com/Community/Discussion/showthread.php?238276-Windows-Phone-8-development-on-Mac-and-VMWare-also-using-the-Phone-Emulator

Good luck with your Windows (Phone) 8 development :)

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Ashish

Thanks for you post. But reading this I would prefer a brand new windows 8 Machine :)

afjsklsjlk

Can someone tell me how to enable virtualization? You can't run the emulator without that. Macbook Air 2012.

ToddySM

@ afjsklsjlk: You should run in problems only if you want to do WinPhone development because the emulator requires Intel VT-x or AMD-V virtualization technology. Windows 8 emulator should run without this.

You may want to try the following two links:

http://support.apple.com/kb/TS2744
http://stackoverflow.com/questions/13580491/how-to-enable-support-of-cpu-virtualization-on-macbook-pro

However if your Mac is too old its CPU may not have the hardware vritualization technology build-in. My MacBook Pro was bought in 2010 and it was the last one lacking the technology from Intel, hence I wasn't able to run the Phone emulator but I am able to run the Win8 emulator.

Hope this helps.

The comments to this entry are closed.