Search code examples
visual-studioxamarinios-simulatormaui

Visual Studio's iOS Simulator for Windows won't launch, stuck in connecting loop for Xamarin or MAUI


After updating to Visual Studio 17.6.3, Xamarin 17.6.0.251 and MacOS Ventura 13.4, I can no longer deploy and run the VS iOS Simulator for Windows.

The application builds and the simulator for Windows launches, but the simulator never connects to the Mac and the application is not deployed. Instead, the simulator gets stuck in a "Connecting to Mac...Checking Server...Connected..." loop.

Deploying to a physical device works as expected.


Solution

  • This is a known issue and is somewhat obscurely documented on the MAUI troubleshooting page:

    In some circumstances, an Xcode configuration problem can result in the remote iOS Simulator for Windows getting stuck in a Connecting to Mac...Checking Server...Connected... loop. When this occurs, you need to remove and reset the Simulators on your Mac build host:

    From the troubleshooting page, the issue can be resolved for both Xamarin and MAUI with the following steps:

    1. Ensure that Xamarin Mac Agent (XMA) and Xcode aren't running.
    2. Delete your ~/Library/Developer/CoreSimulator/Devices folder.
    3. Run killall -9 com.apple.CoreSimulator.CoreSimulatorService.
    4. Run xcrun simctl list devices.

    I also recommend restarting Visual Studio on Windows and reconnecting to the Mac as well.

    Note that any state/configuration changes you've made on the simulators will be reset to their defaults by step 2 above. This includes settings, iCloud configuration, etc. You may want to make note of those settings if needed before deleting the Devices folder.

    Many, many special thanks go to @gerald-versluis who helped me find the above solution with his blog post about the issue.