Unity has a feature called the Unity Remote which is an app that you run on an Android or iOS device. The editor talks to this app via USB and sends the render output of the game as it is running in the editor to the device. The touch inputs from the device along with other device-specific data such as GPS and accelerometer are also sent back to the editor. This gives you an idea of how your game looks on a device and also lets you test touch controls and other device hardware without having to constantly do full builds.
That’s the theory, anyway. A lot of people have complaints about the Unity Remote, saying that it doesn’t work very well or at all.
I’ve always felt that Unity should have a live debug view of the game running on the device that shows you all the GameObjects and their components and serialised fields. I imagined it would look like the regular built-in hierarchy and inspector windows, except it would be pulling the data via a network connection from the live build. A lot of AAA engines have a live update feature like this but Unity has nothing.
In 2014 I started work on a tool to do just this. I built an initial prototype with plans to sell it on the asset store. But then contracting jobs got in the way, and I put the project on hold. Late last year my contract work dried up, and I decided it was time to get back to it and finish it off, so I’ve spent the last four months working on it. It’s now working pretty well:
You can sit in Unity, bring up the Remote Debug window, connect to your device, and see what’s happening on it, just as though you were looking at a build running in the editor. It’s really easy to iterate on things on the device, and I’ve found it especially useful for tweaking touch controls.
Currently it requires Unity 5.3.2f1 or better because I’m using the new
Scene.GetRootGameObjects API that was added. I can make it work in previous versions of Unity but with some unfortunate side effects depending on what API I use. If I use
Object.FindObjectsOfType I can’t get inactive objects. There is also
Resources.FindObjectsOfType but it returns all objects including resources that were manually loaded from the Resources directory. I think I can filter these out, but it just means the server is a bit more costly in terms of memory and CPU. This is something I want to do though because it would be great to provide versions of the tool for Unity 5.x across the board.
I’ve made a thread on the Unity forums about Hdg Remote Debug. If you want more information feel free to post there or email us here at Horse Drawn HQ. The tool should be going live on the asset store in the next couple of weeks.