[英]xamarin for visual studio not showing simulator list
I'm pretty new to xamarin, tried to run a sample application (IOS).我对 xamarin 很陌生,试图运行一个示例应用程序(IOS)。 But Visual Studio says:
"Please select a valid device before running the application"
但是 Visual Studio 说:
"Please select a valid device before running the application"
I know on the IOS toolbar, there should be option to select which device to simulate (list of supported IOS devices like iphone 6, 5s etc), but I don't get that.我知道在 IOS 工具栏上,应该有选项可以选择要模拟的设备(支持的 IOS 设备列表,如 iphone 6、5s 等),但我不明白。
EDIT: To be more precise, TARGET IOS Device not shown on IOS Tool bar编辑:更准确地说,目标 IOS 设备未显示在 IOS 工具栏上
I had the same problem a year back - please check the following:一年前我遇到了同样的问题 - 请检查以下内容:
I think for me it was outdated versions and a hickup in the software, after a reboot it worked.我认为对我来说这是过时的版本和软件中的故障,重新启动后它可以工作。
OR If above steps do not work then try adding new build configuration as shown in following image by selecting iphoneSimulator.或如果上述步骤不起作用,则尝试通过选择 iphoneSimulator 添加新的构建配置,如下图所示。
Once in a while I always used to have this issue and solves it by starting Xcode first and then opening VS after.偶尔我总是遇到这个问题,并通过先启动 Xcode 然后再打开 VS 来解决它。 But recently it became consistent after Xcode 12.5 update.
但最近在 Xcode 12.5 更新后变得一致。 So as a trial, I uninstalled VS and reinstalled and now this workaround also stopped working.
因此,作为试用,我卸载了 VS 并重新安装,现在此解决方法也停止工作。 It's very annoying and there is a bug already reported to Microsoft to fix this.
这很烦人,并且已经向微软报告了一个错误来解决这个问题。
The solution that worked for me is to对我有用的解决方案是
Unfortunately, you always have to open your sample sln first (but no need to create new sln every time) whenever you want to open your solution.不幸的是,每当您想打开您的解决方案时,您总是必须首先打开您的示例 sln(但无需每次都创建新的 sln)。 But it solves the problem.
但它解决了问题。
If you're using the latest XCode version, be sure it's compatible with your Xamarin.iOS and Visual Studio.如果你使用的是最新的 XCode 版本,请确保它与你的 Xamarin.iOS 和 Visual Studio 兼容。 For me, XCode 13 came out a few days ago and wasn't compatible with the latest Visual Studio.
对我来说,XCode 13 几天前发布,与最新的 Visual Studio 不兼容。 You can download an older version of XCode at https://developer.apple.com/download/more/ , just be sure to change visual studio to point to the downgraded version in Visual Studio > Preferences > SDK Locations > Apple
您可以在https://developer.apple.com/download/more/下载旧版本的 XCode,只需确保在 Visual Studio > Preferences > SDK Locations > Apple 中将 Visual Studio 更改为指向降级版本
I had a similar issue.我有一个类似的问题。 However, I was able to resolve it by going to XCode>Preferences>Accounts>ViewDetails>Download all.
但是,我可以通过转到 XCode>Preferences>Accounts>ViewDetails>Download all 来解决它。 This caused visual studio to now display my device IOS name in the dropdown menu.
这导致 Visual Studio 现在在下拉菜单中显示我的设备 IOS 名称。
另一个可能的原因:在编辑 iOS 平台项目的 info.plist 时出错可能会导致这种情况发生。
This has started helping me out a lot with VS for Mac when all other options have failed!当所有其他选项都失败时,这已经开始帮助我使用 VS for Mac 了!
sudo xcode-select --switch /Applications/Xcode.app
sudo xcode-select --switch /Applications/Xcode.app
My issue was that I needed to log into my Apple developer account in XCode again.我的问题是我需要再次在 XCode 中登录我的 Apple 开发者帐户。 For some reason it was showing an error state in XCode>Preferences>Account
出于某种原因,它在 XCode>Preferences>Account 中显示错误状态
I logged into my account again then clicked the "download manual" button and now the devices show up in VS.我再次登录我的帐户,然后单击“下载手册”按钮,现在设备显示在 VS 中。
Are you sure that the device is connected to the right machine?您确定该设备已连接到正确的机器吗? When I have a VM open on my iMac, I get prompted for which machine I want to connect a device to.
当我在 iMac 上打开 VM 时,系统会提示我要将设备连接到哪台机器。
Also make sure that you have Debug
and iPhone Simulator
selected.还要确保您选择了
Debug
和iPhone Simulator
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.