Version: 2022.3
Language : English
Device Simulator
The Simulator view

Device Simulator introduction

The Device Simulator is a Unity Editor feature that simulates how your application appears and behaves on a mobile device.

The Device Simulator consists of:

  • The Simulator view: Views your application on a simulated mobile device.
  • Simulated classes: Tests code that responds to device-specific behaviors.
  • Device definitions: Describes the device to simulate.
  • Device Simulator plugins: Configures the UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
    See in Glossary
    of the Simulator view.

Controls in the Simulator view

The Simulator view simulates many common features of mobile devices, including:

  • Auto-rotation
  • Screen safe area
  • Touch input

Player Settings

The Device Simulator reacts to the following Player SettingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary
in the same way that a real device does:

  • Fullscreen Mode
  • Resolution Scaling
  • Default Orientation
  • Graphics API
  • Render outside safe area

Simulated touch input

If you click on the simulated device screen with the mouse cursor, the device simulator creates touch events in the active input solution (either the Input ManagerSettings where you can define all the different input axes, buttons and controls for your project. More info
See in Glossary
, the Input System, or both, depending on your project settings).

Note: The Device Simulator only simulates input when the Editor is in Play mode. The Device Simulator doesn’t support multitouch; it can only simulate one finger touch.

Limitations

The main purpose of the Device Simulator is to view the layout of your application on a target device and test basic interactions. It doesn’t provide an accurate representation of how your application runs on the device.

The Simulator view does not simulate the following:

  • The performance characteristics of a device, such as a device’s processor speed or available memory.
  • The rendering capabilities of a device.
  • Native plugins that don’t work in the Editor.
  • Platform #define directives for the simulated device, like UNITY_IOS.
  • Gyroscope rotation.

Only one Simulator view can simulate at one time. This is the active Simulator view.

  • If you have only one Simulator view open and no Game views open, the one Simulator view is active regardless of whether it’s visible or not.
  • If you have multiple Simulator views open and no Game views open, the last Simulator view that had focus is active.
  • If you have a mix of Simulator views and Game views open, if you focus a Game view, Unity disables all simulators and if you focus a Simulator view, the Simulator view remains active while it has focus.

The Device Simulator doesn’t simulate all APIs in the simulated classes. For more information, see Simulated classes.

Device Simulator
The Simulator view
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961