Search Unity

Build and port for Chrome OS

June 24, 2021 in Engine & platform | 6 min. read
Chrome OS support header
Chrome OS support header

Is this article helpful for you?

Thank you for your feedback!

Starting with 2021.2 beta, you’ll be able to build or port your Android title for Chrome OS in Unity’s Android Dev environment.

We’re excited to announce that we’ve partnered with Google to integrate Chrome OS into the Android developer environment. From Unity 2021.2 onward, you’ll be able to add Chrome OS functionality to your new and existing Android applications. In addition, we’ll be backporting Chrome OS support to 2021.1 and 2020LTS later this year. Unity will support Chrome OS devices that run on x86–x64, as well as Arm.

Chrome OS has been the fastest-growing segment in the laptop/PC market, with more than 100% year-over-year growth in 2020 and over 30 million Chromebooks shipped in the same 12-month period – already there were 11 million shipped in Q1 of this year! Chrome OS is particularly strong for educational and casual home use, making Chromebooks a great opportunity to bring mobile games to an even broader audience. As more Android users opt for Chromebooks, we believe that this platform would be an interesting opportunity for Android devs.

Getting started with Chrome OS

Editor screenshot configuration

Since Chrome OS functionality is found within the Android environment, you won’t have to manage multiple platforms in the Editor. In addition, enabling support for Chrome OS is as simple as checking a box. To get started, you’ll need to go to Build Setting and choose Android. From there, you can choose to build for Chrome OS through the player settings (see the image above). Allowing a Chrome OS artifact to be built from the same project and build target is convenient, because it reduces duplicate code and streamlines the publishing pipeline.

Adding keyboard and mouse support

Creators have two options when it comes to supporting keyboard, mouse, touchpad, and gamepads for Chromebooks (touch controls will carry over from Android titles for Chrome tablets and Chromebooks with touch inputs). You can use the default option, where Chrome OS maps these input events to touchscreen events, so that your existing Android input codes works without change, or you can program your own input controls using Unity’s Input System. We recommend writing your own input controls to define a better user experience – this also gives you access to mouse positional updates and lets you create touchpad and right-click events. To write your own input controls, uncheck the Chrome OS Input Emulation box in the Android player settings.

Window management

Unlike Android devices, Chrome OS devices support multiple windows, and these can have  different aspect ratios than traditional mobile devices. Unity supports the same multi-window features as Android for tablets and Chromebooks. The different type of windowing supported are:

  • Freeform windows and full-screen mode – As in a traditional desktop environment, windows can be moved, resized and minimized or maximized.
  • Split screen – There is a known issue that when a Unity app has focus and the screen goes to sleep, the device will wake up and show the Unity app only.
  • We are not currently supporting picture-in-picture functionality.

Profiling and performance optimizations

Chrome OS devices vary in performance and capabilities, which is why profiling and performance optimizations are essential to provide users with a great experience, regardless of which Chromebook they’re running your game on.

You can profile using Unity’s Profiler, and you can also use Android’s device profiler. For x86–x64–based Chromebooks, we recommend using Intel’s Profiler.

Publishing on Google Play

Laptop with Google play

Publishing workflows and monetization systems for Chrome OS are identical to those for Android. This means that your titles, whether they use in-app purchases, ads, or both, will monetize in the same way on Android. This is great news for mobile game publishers, since it’s that much easier to access a new audience. In fact, due to the larger screen size, Chrome OS users are more likely to remain engaged with a title for longer play sessions.

Since Chrome OS titles are found on the Play Store, users can enjoy cross-platform play – they can start a game on Android and continue it on Chrome OS. Furthermore, friends lists and cross-platform multiplayer games should function seamlessly between the two platforms.

What’s next

To get started with Chrome OS, download the 2021.2 beta here and visit its documentation page. Once you’ve jumped in, you can leave feedback on our forum to let us know about what’s working well for you and point to any bugs and functionality issues you encounter. Keep an eye out for more content and future releases of Chrome OS in Unity’s 2021.1 and 2020 LTS.

June 24, 2021 in Engine & platform | 6 min. read

Is this article helpful for you?

Thank you for your feedback!