how to get current platform os ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By socheat.khauv
:warning: Old Version Published before Godot 3 was released.

is there a way to know, whether we are running on Android, iPhoneOS, MacOS, Linux ?

:bust_in_silhouette: Reply From: JTJonny

This should work.


String get_name() const
Return the name of the host OS. Possible values are: "Android", "BlackBerry 10", "Flash", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "WinRT", "X11"

Would Xbox OS be Windows for something different, I know it runs a version of Windows but I just wanted to know if its called something different

CreekWorks | 2020-05-19 15:36

It would be "UWP".

exuin | 2021-04-20 13:41

:bust_in_silhouette: Reply From: stingydev

If you want to get more information, I shared a singleton code example to handle the OS and platform.