【问题标题】:MonoTouch runtime test to see if it's running in the simulatorMonoTouch 运行时测试,看看它是否在模拟器中运行
【发布时间】:2012-06-04 13:22:35
【问题描述】:

可能真的很简单,但我找不到答案 - 如何在运行时进行检查(使用 MonoTouch)以确保我在 iPhone 模拟器中(或不在)?

谢谢

【问题讨论】:

    标签: c# xamarin.ios simulator


    【解决方案1】:

    你可以这样做:

    using MonoTouch.ObjCRuntime;
    static bool InSimulator ()
    {
        return Runtime.Arch == Arch.SIMULATOR;
    }
    

    来自这里:http://docs.xamarin.com/ios/recipes/General/Projects/Environment_Checks

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-27
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多