Post

Testing HoloLens app in Unity Editor

If you recently started exploring HoloLens development and followed Holographic Academy tutorials you might have realized testing small stuff, like changing position of a game object, can get cumbersome very quickly. First you need to export a Visual Studio solution, then compile the solution and deploy your app to the Emulator or the real device. Depending on the project and your computer’s configuration, this might take a while and get frustrating pretty quickly.

I was having the same problem and there are 2 things I discovered that didn’t explicitly mentioned neither in tutorials nor in Microsoft’s developer guides. Firstly, you don’t have to export a Visual Studio solution every time you only changed a script, you can just compile and test with your existing solution.

But the second thing is absolute time saver. Microsoft has several open source projects ([1] [2] [3]) on HoloLens that includes bunch of useful script and prefabs like head stabilizer or cursors. One of the projects, HoloToolkit-Unity, comes with Unity specific tools, such as in editor controls. So when you follow the instructions on Getting Started Guide and added HoloToolkit-Unity to your project, you can test your changes directly on the editor without going through deployment process, voila!

Of course there are some caveats, for example audio input does not work. Moreover I have encountered some rare cases that worked on the editor but not on the device. But regardless, it’s the best way right now to have fast iterations on your code and scene.

On a side note; HoloToolkit-Unity also has a build window that allows you directly deploy your app to the device or the emulator -which is also quite helpful.

This post is licensed under CC BY 4.0 by the author.