There is no ‘#define directives’ to indicate whether the current unity editor installs the iOS or Android module.
Our code reference some API and namespace like ‘UnityEditor.iOS.XCode’. This will make some users report errors if they do not install the platform module(Which is really large, most of the artists will not install them).
As an alternative, we can use the directives like ‘UNITY_IOS’. But it does not mean I have the iOS module installed, but means the current build target is iOS.
As an example, if I write a build pipeline script in c#. It will include switching the build target and executing the build process. If the start build target is windows, the code wrapped in ‘UNITY_IOS’ will not be executed, even if we switch the build target in code, because the assembly is not reloaded.
When I install the ios module, it should be safe to invoke the APIs even if I am not under the ios build target. So I really hope there have ‘#define directives’ for this platform install state.