Visual Studio 构建错误:操作无法完成。无法找到任何模拟器运行时匹配选项

问题描述 投票:0回答:2

MacOS 更新后,Visual Studio 停止使用配对的 Mac 计算机构建 .NET MAUI iOS 项目。报告以下错误:

The operation couldn’t be completed. Failed to locate any simulator runtime matching options: {
    BuildVersionString = 21E210;
    Platforms =     (
        "com.apple.platform.iphonesimulator"
    );
    VersionString = "17.4";
}

如何解决这个问题?

visual-studio
2个回答
1
投票

在 Mac 上,打开终端并运行以下命令:

xcodebuild -downloadAllPlatforms

等待命令执行完成,在 Windows 计算机上重新启动 Visual Studio 并尝试再次构建项目。


0
投票

接受的答案可能会下载您不需要的平台(例如 WatchOS)的模拟器。更精细的方法是将 XCode 加载到 XCode 菜单 -> 设置 -> 平台并安装缺少的模拟器。

enter image description here

我还删除了大约 20GB 不需要的模拟器,这是一个不错的奖励。

© www.soinside.com 2019 - 2024. All rights reserved.