Xamarin-macios: [Xcode11] [Simulator] Updating to Xcode 11 stops the simulator from launching.

Created on 6 Jun 2019  路  14Comments  路  Source: xamarin/xamarin-macios

After updating to Xcode 11 beta 1 every time that a simulator is tried to be launched the following exception is thrown resulting in no simulator running. This happens with all simulators.

Exception

Foundation.ObjCException: NSInvalidArgumentException: -[SimDevice registerNotificationHandler:]: unrecognized selector sent to instance 0x7ffbf5d1e110

Workaround

Until there is fix, the following steps can be followed to re-install the old simulator framework to allow developers to continue their work:

  1. Ensure that you have Xcode 11 selected via xcode-select:
    sudo xcode-select -s /Applications/Xcode11-beta1.app/Contents/Developer/
  2. Run, if needed, the setup tools for the first time.
    `/Applications/Xcode11-beta1.app/Contents/Developer/usr/bin/xcodebuild -runFirstLaunch
  3. Remove the following framework:
    sudo rm -Rf /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/*
  4. Switch back to the old Xcode version
    sudo xcode-select -s /Applications/Xcode102.app/Contents/Developer/
  5. Re-run the first launch tool for the _OLD_ Xcode version you just selected
    /Applications/Xcode102.app/Contents/Developer/usr/bin/xcodebuild -runFirstLaunch

After following the above steps, you should be able to work with simulator again.

VS bug #916235

bug vs-sync

Most helpful comment

Another workaround is to launch the simulator manually from Xcode 10.2. Visual Studio will then use that instance of the simulator for debugging.

All 14 comments

Another workaround is to launch the simulator manually from Xcode 10.2. Visual Studio will then use that instance of the simulator for debugging.

@Uncommon nice catch, I did not try that, thx!

re-opening (it's sync'ed with vsts)

Is this issue really closed? I have it with Xcode 11.0 beta 5 and can't make my simulator work. Compiling of app works

@nschoenberg were you able to use the simulator with Xcode 11?

@maculit with the newest version of xcode 11.1 the problem ist solved on my side.

Seeing the same issue with Xcode v11.2.1

@lselbeck which version of Xamarin.iOS are you using? And what's the exact output?

@rolfbjarne Xamarin.iOS v13.6.0.12, output:
```SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Failed to launch simulator

ExitCode: 134
0 CoreFoundation 0x00007fff4dcc6acd __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff783c8a17 objc_exception_throw + 48
10 FBSimulatorControl 0x000000010694f576 +[FBSimulator fromSimDevice:configuration:launchdSimProcess:containerApplicationProcess:set:] + 598
11 FBSimulatorControl 0x0000000106952aad -[FBSimulatorInflationStrategy inflateSimulators:availableDevices:previouslyIdentifiedContainerApplications:] + 1085
12 FBSimulatorControl 0x0000000106952588 -[FBSimulatorInflationStrategy inflateFromDevices:exitingSimulators:] + 1208
13 FBSimulatorControl 0x00000001069177f1 -[FBSimulatorSet allSimulators] + 145
14 FBSimulatorControl 0x000000010691508d -[FBSimulatorSet query:] + 173
15 iOSDeviceManager 0x00000001066f6f0b +[Simulator withID:] + 246
16 iOSDeviceManager 0x00000001066ef37d +[Device withID:] + 118
17 iOSDeviceManager 0x00000001066f27a8 +[Command simulatorFromArgs:] + 163
18 iOSDeviceManager 0x00000001066feb4c +[LaunchSimulatorCommand execute:] + 20
19 iOSDeviceManager 0x00000001066f51ee +[CLI process:] + 1111
2 CoreFoundation 0x00007fff4dd408d6 -[NSObject(NSObject) __retain_OA] + 0
20 iOSDeviceManager 0x00000001066e0609 main + 121
21 libdyld.dylib 0x00007fff79b973d5 start + 1
3 CoreFoundation 0x00007fff4dc6893f ___forwarding___ + 1485
4 CoreFoundation 0x00007fff4dc682e8 _CF_forwarding_prep_0 + 120
5 FBSimulatorControl 0x000000010693cad9 -[FBCoreSimulatorNotifier initWithNotifier:queue:block:] + 377
6 FBSimulatorControl 0x000000010693c7cc +[FBCoreSimulatorNotifier notifierForSimDevice:queue:block:] + 188
7 FBSimulatorControl 0x000000010694b3fb -[FBSimulatorEventRelay createNotifierForSimDevice:] + 251
8 FBSimulatorControl 0x0000000106949902 -[FBSimulatorEventRelay initWithSimDevice:launchdProcess:containerApplication:processFetcher:queue:sink:] + 594
9 FBSimulatorControl 0x000000010694fba2 -[FBSimulator attachEventSinkCompositionWithLaunchdSimProcess:containerApplicationProcess:] + 754
(
)
* First throw call stack:
2019-11-14 10:00:11.651 iOSDeviceManager[54190:789807] -[SimDeviceNotificationManager registerNotificationHandler:]: unrecognized selector sent to instance 0x7f93036021c0
2019-11-14 10:00:11.652 iOSDeviceManager[54190:789807] *
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SimDeviceNotificationManager registerNotificationHandler:]: unrecognized selector sent to instance 0x7f93036021c0'
libc++abi.dylib: terminating with uncaught exception of type NSException```

@lselbeck that doesn't come from any tool shipped from this repository. Exactly where did you see that and what did you do to see it?

This is on VS for Mac v8.3.8 when attempting to run NUnit v2.6.4 tests on a Xamarin.iOS project. The failing line being
c# return Xamarin.UITest.ConfigureApp.iOS.StartApp();

Same issue here with Xcode 11.2.1

@lselbeck I believe Xamarin.IOTest is AppCenter, and this describes how to report bugs with them: https://docs.microsoft.com/en-us/appcenter/help

Looks like this issue is fixed but why would I still get this error message today?

The app has been terminated.
Launch failed. The app 'xxxxxx' could not be launched on 'xxxxx'. Error: error MT1008: Failed to launch the simulator: NSInvalidArgumentException: -[SimDevice registerNotificationHandler:]: unrecognized selector sent to instance 0x7f85be228c70.

I'm running VS 15.9.20 and Xcode 11.3.1. I did upgrade to Xcode 11 recently. Any input greatly appreciated.

Was this page helpful?
0 / 5 - 0 ratings