Bug 482 - Add SIMULATOR define for simulator builds
Summary: Add SIMULATOR define for simulator builds
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: Macintosh Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Mono Bugs
Depends on:
Reported: 2011-08-26 17:12 UTC by Sebastien Pouliot
Modified: 2011-09-02 14:26 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Sebastien Pouliot 2011-08-26 17:12:05 UTC
XCode has some defines* that would be helpful for MonoTouch. E.g. to have conditional code for the simulator (some bugs we have crash only on the simulator).

Comment 1 Mikayla Hutchinson [MSFT] 2011-08-26 21:25:30 UTC
We had a bug on Novell bugzilla for this, I looked into it but it wasn't as trivial to implement as it sounds, because project types have no control over the defines - those are handled by the language addins.
Comment 2 Jeffrey Stedfast 2011-08-27 16:51:27 UTC
Couldn't we just add this to mtouch?
Comment 3 Mikayla Hutchinson [MSFT] 2011-08-27 17:36:44 UTC
No, mtouch doesn't compile the C# files.
Comment 4 Miguel de Icaza [MSFT] 2011-08-29 16:32:10 UTC
For the record, this is what we can use for Runtime decision making:

bool isDevice = MonoTouch.ObjCRuntime.Runtime.Arch == MonoTouch.ObjCRuntime.Arch.DEVICE;
Comment 5 Alan McGovern 2011-09-02 14:26:19 UTC
fixed in git.