Bug 1485 - iPhone Simulator not found after upgrade to SDK 5 - How to set it?
Summary: iPhone Simulator not found after upgrade to SDK 5 - How to set it?
Status: RESOLVED NORESPONSE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 2.8
Hardware: Macintosh Mac OS
: Low normal
Target Milestone: ---
Assignee: Alan McGovern
URL:
Depends on:
Blocks:
 
Reported: 2011-10-13 17:29 UTC by Ian
Modified: 2013-12-05 18:35 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED NORESPONSE

Description Ian 2011-10-13 17:29:35 UTC
I installed MD 2.8, MT 5.0, then upgraded to Lion, then installed the XCode SDK for Lion for iOS 5.

I installed the iOS 5 SDK to its own folder /developer/ios5 and left the older SDKs there.

When I run MT:
==============
I can set the target of a project to 5.0 in MonoDevelop by going to the properties of the project. However, the simulator choice is limited to the old 4.3 and below when I try to set that using the menu.

When I build and run the debug, it loads the app correctly, but strangley asks for the location of the simulator at the same time.

I hit cancel on that "locate the simulator" dialog and get this error:

System.Exception: Error ScriptError: 
  at MonoDevelop.MacInterop.AppleScript.Run (Boolean compile, MonoDevelop.MacInterop.AEDesc& scriptData) [0x00012] in /private/tmp/source/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:107 
  at MonoDevelop.MacInterop.AppleScript.Run (System.String scriptSource) [0x00010] in /private/tmp/source/monodevelop/main/src/addins/MacPlatform/MacInterop/AppleScript.cs:83 
  at MonoDevelop.IPhone.IPhoneUtility.MakeSimulatorGrabFocus () [0x00000] in /private/tmp/source/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/IPhoneCommands.cs:345 
  at MonoDevelop.Debugger.Soft.IPhone.IPhoneDebuggerSession.StartSimulatorProcess (MonoDevelop.IPhone.IPhoneExecutionCommand cmd) [0x00052] in /private/tmp/source/md-addins/MonoDevelop.IPhone/MonoDevelop.Debugger.Soft.IPhone/IPhoneDebuggerSession.cs:93 
  at MonoDevelop.Debugger.Soft.IPhone.IPhoneDebuggerSession.OnRun (Mono.Debugging.Client.DebuggerStartInfo startInfo) [0x00019] in /private/tmp/source/md-addins/MonoDevelop.IPhone/MonoDevelop.Debugger.Soft.IPhone/IPhoneDebuggerSession.cs:58 
  at Mono.Debugging.Client.DebuggerSession+<Run>c__AnonStorey6.<>m__3 () [0x00000] in /private/tmp/source/monodevelop/main/src/core/Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs:306
Comment 1 Sebastien Pouliot 2011-10-13 17:50:59 UTC
-> monodevelop
Comment 2 Mikayla Hutchinson [MSFT] 2011-10-13 18:10:27 UTC
Which did you set, the deployment target or the SDK? Don't change the SDK from "default" unless you have a really good reason to do so. You can target older OS versions by changing the deployment version.

What asks for the location of the simulator? I'm pretty sure MD doesn't do that.

We should make the "make simulator grab focus" command resilient against the simulator failing to run, but that isn't the real problem here.
Comment 3 Ian 2011-10-13 18:23:50 UTC
I left deployment target at 3.2

I tried setting the iPhone Simulator Target to Default and don't get any errors now, but as I don't see 5.0 in the list, does that mean that I need to tell MT in some way where iOS 5's SDK is so that we can test our apps against 5.0 devices in the simulator?
Comment 4 Mikayla Hutchinson [MSFT] 2011-10-13 18:33:45 UTC
In MD preferences.Other->SDK locations, you can configure the location of the Apple toolchain you want to use. The SDKs MD offers in the dropdowns are those that it find in the configured Apple toolchain. Similarly, the simulators versions MD offers are the simulator images it finds in the configured Apple toolchain that are compatible with the device type and deployment target.

If MD is set to use a specific simulator version, it'll try to switch the simulator to that version. Else, it'll try to use the simulator version matching the SDK version. I suppose it's possible that might not exist in some cases, and I'm not sure how robust the checks are.
Comment 5 Ian 2011-10-13 18:36:34 UTC
I found that to set the SDK:

Use MonoDevelop menu;
Select Preferences...* item;
Under Others select SDK Locations in the left tree view;
Select manuall the location of the iOS5 SDK

I set it to /Developer/ios5 and it liked it.

However, with the target set to 3.2 in the project properties and the simulator set to "default" with only 5.0 Simulators available in the picker now, I get this error when I try to debug an app:


Invalid SDK specified: 5.0
Stacktrace:

  at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_intptr_intptr_bool (intptr,intptr,intptr,intptr,bool) <0xffffffff>
  at MonoTouch.Foundation.NSObject.Dispose (bool) <0x0009f>
  at MonoTouch.Foundation.NSObject.Finalize () <0x00016>
  at (wrapper runtime-invoke) object.runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	0   mtouch                              0x000ec183 WriteZStream + 955779
	1   mtouch                              0x0001bd4f WriteZStream + 102735
	2   libsystem_c.dylib                   0x9b02959b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   Foundation                          0x995f23de -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 160
	5   ???                                 0x027d42ac 0x0 + 41763500
	6   ???                                 0x027cfe40 0x0 + 41745984
	7   ???                                 0x027d3fc7 0x0 + 41762759
	8   ???                                 0x026e5551 0x0 + 40785233
	9   mtouch                              0x001a76c4 WriteZStream + 1723076
	10  mtouch                              0x001a968a WriteZStream + 1731210
	11  mtouch                              0x001a98c4 WriteZStream + 1731780
	12  mtouch                              0x002735c1 WriteZStream + 2558401
	13  mtouch                              0x00273677 WriteZStream + 2558583
	14  mtouch                              0x002b8b0e WriteZStream + 2842382
	15  mtouch                              0x002f31d8 WriteZStream + 3081688
	16  libsystem_c.dylib                   0x9afd1ed9 _pthread_start + 335
	17  libsystem_c.dylib                   0x9afd56de thread_start + 34

Debug info from gdb:

/tmp/mono-gdb-commands.RUPUmS:1: Error in sourced command file:
unable to debug self

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 6 Ian 2011-10-13 18:39:38 UTC
I think there is a mis match in folders. Have a look at this build output. It's not looking for the simulator in the right place (I installed to "/Developer/IOS5". It's looking for "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk" which does not exist.



Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign -sim "/Users/vink/Dropbox/Ajilon Source/Apps/Customers/NSW/Claims/bin/iPhoneSimulator/Debug/CrashSupport.app" -r "/Users/vink/Dropbox/Ajilon Source/Apps/Utils/Newtonsoft.Json.MonoTouch/bin/iPhoneSimulator/Debug/Newtonsoft.Json.MonoTouch.dll" -r "/Users/vink/Dropbox/Ajilon Source/Apps/Utils/MonoTouch.Dialog/MonoTouch.Dialog/bin/iPhoneSimulator/Debug/MonoTouch.Dialog.dll" -r "/Users/vink/Dropbox/Ajilon Source/Apps/Utils/Ajilon.Common/bin/iPhoneSimulator/Debug/Ajilon.Common.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -debug -nolink -sdk "5.0" -targetver "3.2" "/Users/vink/Dropbox/Ajilon Source/Apps/Customers/NSW/Claims/bin/iPhoneSimulator/Debug/Claims.exe"
Framework does not exist /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
   Platform = iPhoneSimulator
   SDK = 5.0
   Deployment Version: 3.2
Framework is: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk

Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/SDKSettings.plist".
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.Xml.XmlUrlResolver.GetEntity (System.Uri absoluteUri, System.String role, System.Type ofObjectToReturn) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.GetStreamFromUrl (System.String url, System.String& absoluteUriString) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.EntityResolvingXmlReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.Schema.XsdValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.Load (System.String filename) [0x00000] in <filename unknown>:0 
  at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.DirectoryNotFoundException: Could not find a part of the path "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/SDKSettings.plist".
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.Xml.XmlUrlResolver.GetEntity (System.Uri absoluteUri, System.String role, System.Type ofObjectToReturn) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.GetStreamFromUrl (System.String url, System.String& absoluteUriString) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained) [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.PeekChar () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.EntityResolvingXmlReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.ReadContent () [0x00000] in <filename unknown>:0 
  at Mono.Xml.DTDValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at Mono.Xml.Schema.XsdValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlValidatingReader.Read () [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0 
  at System.Xml.XmlDocument.Load (System.String filename) [0x00000] in <filename unknown>:0 
  at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0 
mtouch exited with code 1
Comment 7 Mikayla Hutchinson [MSFT] 2011-10-13 18:55:09 UTC
Ah, yes. MD supports a custom Apple SDK location but mtouch doesn't fully support that. I've filed a bug: http://bugzilla.xamarin.com/show_bug.cgi?id=1486
Comment 8 Ian 2011-10-13 19:13:20 UTC
Installing to the default location fixed all the issues.
Comment 9 Jeffrey Stedfast 2012-10-15 18:20:33 UTC
what's the status of this bug? it looks like the mtouch bug was fixed. Does that mean that this problem is fixed? or is there something left to do in MonoDevelop still?
Comment 10 PJ 2013-11-19 17:04:51 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 11 PJ 2013-12-05 18:35:03 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.