Probably really simple, but I can't find an answer - how can I do a check at runtime (using MonoTouch) to make sure I'm in the iPhone simulator (or not) ?
Thanks
The Mono runtime can be used as a stand-alone process, or it can be embedded into applications Embedding the Mono runtime allows applications to be extended in C# while reusing all of the existing C and C++ code. For more details, see the Embedding Mono page and the Scripting With Mono page.
MonoTouch:Limitations 1 Limited Debugging Support. There is no support for debugging in MonoTouch,... 2 Limited Generics Support. Generic virtual methods aren’t supported,... 3 No Dynamic Code Generation. Since the iPhone’s kernel prevents an application from generating code... 4 No Remoting. The Remoting stack is not available on MonoTouch.
For Mono to gain wide adoption in the UNIX world, it is necessary that the JIT engine works in most of today’s commercial hardware platforms. The new Mono engine now supports both 32 and 64 bit systems and various architectures (See Supported Platforms ). Mono provides a number of profiling tools and code coverage tools.
The idea is to allow developers to pre-compile their code to native code to reduce startup time, and the working set that is used at runtime in the just-in-time compiler. Although in Mono this has not been a visible problem, we wanted to pro-actively address this problem.
You can do it like this:
using MonoTouch.ObjCRuntime;
static bool InSimulator ()
{
return Runtime.Arch == Arch.SIMULATOR;
}
This is from here: http://docs.xamarin.com/ios/recipes/General/Projects/Environment_Checks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With