0

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?

harry_mitch
  • 77
  • 1
  • 8
  • Where can I find the crash log? – harry_mitch Nov 07 '22 at 08:12
  • No. I don't see any error message in the console. Which files are important in this folder? I made a picture of the folder that got created after the last simulator crash. – harry_mitch Nov 07 '22 at 13:13
  • I cannot find any useful information in system.log. – harry_mitch Nov 08 '22 at 09:01
  • The deployment target is set to 15.0 in Info.plist. In my project's properties I have taget iOS version 16.0 and minimum iOS version 15.0. The Apple SDK path is /Applications/Xcode.app/ and it is displayed Xcode 14.1 found at specified location. I use now VS for Mac 2022 17.4 (build 2406). But I have still the same problem with the simulator. – harry_mitch Nov 10 '22 at 12:45
  • I installed Project System Tools for Visual Studio for Mac extension but I cannot find an error message in the binary log file. I added a picture of this log file. – harry_mitch Nov 13 '22 at 17:59
  • I have uninstalled VS for Mac 2022 17.3.8 with the uninstall script: https://learn.microsoft.com/en-us/visualstudio/mac/uninstall?view=vsmac-2022#visual-studio-for-mac-and-xamarin-script After that I have installed VS for Mac 17.5 Preview but the simulator is still not working. – harry_mitch Nov 20 '22 at 14:45

1 Answers1

0

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.

Zack
  • 1,255
  • 1
  • 2
  • 5
  • I will try if it works with VS 2022 17.3.6. But I found out that the same problem exist in VS 2019 for Mac. I have added a new picture with the error from VS 2019 for Mac. – harry_mitch Nov 22 '22 at 09:56
  • I got this new error message in VS 2022 17.5 Preview after I have fixed the simulator problem in VS 2019 for Mac: https://stackoverflow.com/questions/74532580/unable-to-find-sdk-microsoft-net-sdk-in-visual-studio-for-mac-17-5-preview – harry_mitch Nov 22 '22 at 16:08
  • The iPhone simulator works now in VS 2022 for Mac 17.5 Preview with Xcode 14.1. I installed .NET 6.0 and .NET 7.0. https://dotnet.microsoft.com/en-us/download – harry_mitch Nov 23 '22 at 08:57