Question

My question is how to make sure the app is running from a mobile device and not over a emulator? Unity Preprocessor can tell the difference?

My code is something like this:

#if  UNITY_IPHONE
    Debug.Log("Running on Apple Device.");
#elif UNITY_ANDROID
    Debug.Log("Running on Android Device.");
#elif UNITY_WP8
    Debug.Log("Running on WP Device.");
#else
    Debug.Log("Not running on mobile Device.");
#endif

Thanks in advance

Was it helpful?

Solution

Unfortunately not. As the Unity3D Preprocessor documentation shows, there are only defines for the device types.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top