How many smartphones have you owned in your lifetime? Have you ever had to worry about whether an app or game would render well on your new phone? Or if your device resolution is supported by your favorite game?
Of course you haven’t — it’s the developer’s job to figure that out for you!
Unity game engine has been around since 2005, but only in 2019 did they release the Device Simulator feature as a preview package. As the name implies, Device Simulator allows you to preview how your game will look on multiple devices without all the hassle of testing on said devices. Before then, your options included:
- Owning a whole bunch of phones with different screen resolutions, AND
- Building your app binary for each and every device and testing your app on each device
Not many people had the time and money to do this, and so many devices went untested, and developers opted for the best experience on the most popular resolutions. Those dark days are over — and there’s no reason to not use this amazing add-on. Without further ado, let’s discuss the incredibly simple instructions on how to use the Device Simulator and the benefits that will come with it.
Note: This tutorial assumes the use of the 2020.1.0f1 version of Unity!
1. Open Unity, then select Window > Package Manager from the top menu bar. With Package Manager open, select the dropdown in the top-left and choose Unity Registry.
2. Click the little gear icon near the top-right search bar, and select Advanced Project Settings. In this window, click the checkmark for Enable Preview Packages. You can go ahead and ignore the warning! Experimenting with a bunch of preview packages can cause issues, but we are only using one in this tutorial.
3. Choose “Device Simulator” in the package list, and click Download, then Install in the bottom right.
Top 10 Unity Tricks That Will Speed Up Your Game Development
These tips will definitely save you time on your next game dev project!
4. Now, open up Device Simulator from the top menu bar: Window > General > Game. In the top-left click the dropdown that says “Game” and switch to “Simulator”
5. Et viola! You are now free to play around with Device Simulator. Note — You can also switch from Simulator to Game view easily while in Edit or Play Mode!
Now you may be wondering — “Hey this looks good and all, but what makes this more than just a skin on top of my normal Game view in Unity?” I’m glad you possibly asked this question! Here are some of the great features that Device Simulator gives us:
- Screen options from dozens of common phone resolutions
- Screen resolution, orientation, auto-rotation, override for standard Player Settings as well
- The Device Simulator enables touch controls vs keyboard, so please keep this in mind when testing! Your mouse cursor simulates a screen tap on click, which can help with testing touch controls.
- Click Highlight Safe Area to draw a rectangle that suggests where the deadzone for your game should be. If you follow this indicator, your game will look great even if your player’s phone has a notch!
If you are a mobile game developer, I highly encourage you to go back to your old projects and take advantage of the Device Simulator feature! I have found it incredibly helpful with pushing updates for some of my older projects.
Are you a Unity game developer looking for the latest tips and tricks with the platform? Check out some of my other tutorials and guides that are bound to help you on your game creation journey.