Use mobile device input in the Editor (Unity Remote)
The Unity Remote is an app available for iOS and Android which allows using a mobile device for input while running in the Unity Editor. You can find details about the app and how to install it in the Unity manual.
If you would like to try out the Unity Remote app, you can install the "Unity Remote" sample that is provided with the Input System package.
Note
Joysticks/gamepads are not yet supported over the Unity Remote. No joystick/gamepad input from the mobile device will come through in the editor.
Note
This requires Unity 2021.2.18 or later.
When in play mode in the Editor and connected to the Unity Remote app, you will see a number of Devices have been added with the InputDevice.remote flag set to true:
If a gyro is present on the mobile device:
These Devices can be used just like local Devices. They will receive input from the connected mobile device which in turn will receive the rendered output of the game running in the editor.
The Accelerometer device will automatically be enabled and will not need you to call InputSystem.EnableDevice explicitly. Setting the sampling frequency on the accelerometer from the Unity Remote using Sensor.samplingFrequency has no effect.
The remaining sensors listed above will need to be explicitly enabled with InputSystem.EnableDevice just like local sensors. Setting the sampling frequency on these sensors from the Unity Remote using Sensor.samplingFrequency will be relayed to the device but note that setting the frequency on one of them will set it for all of them.
Touch coordinates from the device will be translated to the screen coordinates of the Game View inside the Editor.