header image

Tinkering with mobile builds at runtime

Unity’s iOS deployment isn’t particularly speedy. If we make a change to the C# code, or any of our data, we need to do a new iOS build, then compile and deploy the resulting Xcode project. I haven’t timed it, but it’s maybe four or five minutes from go to woah. For the majority of development this isn’t a big issue, as we can quickly run inside the Unity editor. But when we actually have to see the game running on a device, it can significantly impact progress. Often all we want to do is try out a different line width, or station size. We need to be able to see changes instantly.

I remembered when I was at Sidhe Interactive years ago, someone built a telnet server into the PS2 and Xbox builds to allow remote access to the console. The perfect solution! I grabbed a simple C# telnet server implementation (thanks UngarMax!) which ran first time on the iOS build (oddly enough, it doesn’t work on OS X as it requires admin permission). On the home screen I added a text field with the device’s local IP address, fetched through Network.player.ipAddress, so we know where to point telnet.

And just like that, we can remote into development builds of Mini Metro running on iOS devices. We’ve added commands for tweaking the scale of railcars, passengers and stations, and the width of the lines. To help with performance improvements, we can also now toggle the visibility of various elements of the game.

Nice!