It’s actually really simple. One line of code plus the using for the namespace where the Runtime object is found

using MonoTouch.ObjCRuntime;

        public static bool OnSimulator()
        {
            return Runtime.Arch == Arch.SIMULATOR;
        }

The other value of the ARCH enumerations is Arch.DEVICE.

Leave a Reply

Post Navigation