Is it possible to Programatically know if Unity Remote is active?

I know I can use “#if UNITY_EDITOR … #endif” to add code especific to the Editor, but how do I know if Unity Remote specifically is active?

The reason I need to know this, is that I want to tilt my camera using the Gyroscope when I’m using Unity Remote, but use the mouse if I’m just in the Editor without Unity Remote active.

I have just found out. I needed to use “EditorApplication.isRemoteConnected” (might take a few seconds to become true).