iPhone simulators don't work in Visual Studio for Mac 2022

1.1k Views Asked by At

The simulator pops up when I run a new blank iOS project but the problem is that it automatically stops running after the simulator popped up and the application doesn't get installed on the simulator. But exactly the same simulator works fine if I create and run a new iOS App in Xcode. I have tested it with the iPhone 14 Pro Max iOS 16.1 simulator in VS for Mac 2022 17.3.8 (build 5) and Xcode Version 14.1 (14B47b). I have used the template Single View App and the template Blank Xamarin.Forms to test the simulator in VS for Mac 2022.

What is wrong with the simulator in Visual Studio for Mac 2022? How can I use the simulator in VS for Mac 2022?

EDIT: I have tried the iPhone 14 Pro Max iOS 16.1 simulator in my old VS for Mac Community 2019 8.10.25 (build 2) and I have the same problem there. But I get this message in VS 2019:

enter image description here What does this message mean? Is it helpful to find the problem?

EDIT:

The simulator works now in VS 2019 for Mac. I needed to do this in Terminal:

sudo xcode-select -s /Applications/Xcode.app
sudo xcodebuild -license

How do I fix the xcrun unable to find simctl error?

1

There are 1 best solutions below

3
On

Currently, VS2022 is not compatible with Xcode14.1. You could try to download Xcode (Go to downloads page in the Apple Developer Portal , sign in with your apple developer account, select Xcode14.0 to download and install). Then you can open Xcode, go to Preferences > Location > Command Line Tools, and make sure to select version 14.0. You can continue to follow this issue: https://github.com/xamarin/xamarin-macios/issues/16659

Update:I use vs2022 17.3.6 official version XCode version 14.1 simulator can work normally, you can try to reduce the VS version to this version.