Using the Unity Profiler for performance profiling Windows Store Apps in Unity 4.2

Posted by: | Technical |

If you are using the latest version of Unity 4.2 RC which allows in built generation of Windows Store builds and you are hitting performance issues you may wish to attach the Unity Profiler (yes, Unity really should update their documentation to include Windows!) to see what’s going on.

Unfortunately, you will need a second device (PC, Surface RT, Surface Pro etc.) to deploy to, as due to the way Windows Store apps work, you cannot profile an app running on your local dev machine.

Here’s a quick guide to getting it working once you accept that basic, but annoying fact.

  • Configure windows firewall on both devices appropriately, in particular make sure that ports 54998 to 55511 are open in the firewall’s outbound rules – these are the ports used by Unity for remote profiling.
  • Ensure that you have the capabilities Private Networks (Client & Server) and Internet (Client & Server) enabled in your Windows Store App Manifest
  • Check the Autocopnect Profiler checkbox when you do the Windows Store build (via File > Build Settings > Windows Store App).
  • Ensure the remote debugger is running on your target machine (and yes, you can run the remote debugger on your Surface RT)
  • Configure your Windows Store project to use remote debugger (via Project Properties > Debug)
  • F5 from your Windows Store project in Visual Studio (run in debug or release, either works, but be consistent)
  • The initial deploy of your app can take a while the first time if you have a large package over wifi, then it’s incremental after further changes.
  • Once deployed Window > Profiler will show you the wonderful performance information flowing from your app.

Good luck!