Search code examples
unity-game-enginemobiledevice

Get mobile device type in Unity


I want to know the Mobile Device (like iPhone X) in unity.

https://www.theiphonewiki.com/wiki/Models

I got to know whether a device running on unity is iPhone X by this code...

if ( SystemInfo.deviceModel == “iPhone10,3”
|| SystemInfo.deviceModel == “iPhone10,6”)

But, how can I know whether a device is Samsung Galaxy S9 or LG V30?


Solution

  • Using the same function.

    SystemInfo.deviceModel

    https://docs.unity3d.com/ScriptReference/SystemInfo-deviceModel.html

    Unity can also recognize your OS (Operative System). So you can recognize when is an Android Device, iOs Device, or windows platform, even if you are running on your Unity Editor.

    If you are working on VR, you can also discern devices with XR, devices like Oculus, HTC, Cardboard, etc.