Visual Studio 2017无法连接macOS虚拟机安装的Visual Studio for mac和xcode

Ume*_*har 7 c# xcode ios xamarin xamarin.forms

当我将visual studio连接到我的macOS时,我得到以下错误.我正在Win OS上的Visual Studio中构建一个iphone应用程序.当尝试运行应用程序时,它显示此错误:

The Xcode License status couldn't be verified because the 'xcodebuild' tool has not been found on the connected MAC. Having Xcode installed and functional is necessary in order to build and run iOS apps, so please check that xcode is correctly installed and that the path specified under iOS Settings is correct.

看错误的截图:

在此输入图像描述 日志:

Xamarin.Messaging.Ssh.MessagingService|Information|0|Agent IDB 4.9.0.752 is running
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic xma/agent-status was received
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|IDB 4.9.0.752 started
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Starting registered Agents: ...
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Server State transition from AgentsStartingState to AgentsStartedState on 192.168.106.128 (192.168.106.128)
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|The Agents have been started successfully
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Server State transition from AgentsStartedState to ValidatingState on 192.168.106.128 (192.168.106.128)
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Performing server validations against '192.168.106.128'...
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Validating Mac operating system version compatibility...
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching SubscribeAck message to flow ClientSubscribeFlow
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching Publish message to flow PublishReceiverFlow and topic xma/message-status
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic xma/message-status was received
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching Publish message to flow PublishReceiverFlow and topic vs6604UmerF/response/xma/get-env-info
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic vs6604UmerF/response/xma/get-env-info was received
Xamarin.Messaging.Integration.State.ServerStateContext|Information|0|Validating Xcode license state...
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching Publish message to flow PublishReceiverFlow and topic xma/message-status
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic xma/message-status was received
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching SubscribeAck message to flow ClientSubscribeFlow
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching Publish message to flow PublishReceiverFlow and topic xma/message-status
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic xma/message-status was received
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching Publish message to flow PublishReceiverFlow and topic vs6604UmerF/response/xvs/idb/4.9.0.752/get-xcode-location
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic vs6604UmerF/response/xvs/idb/4.9.0.752/get-xcode-location was received
System.Net.Mqtt.Sdk.ClientPacketListener|Information|0|Client vs6604UmerF - Dispatching Publish message to flow PublishReceiverFlow and topic xma/message-status
System.Net.Mqtt.Sdk.MqttClientImpl|Information|0|Client vs6604UmerF - An application message for topic xma/message-status was received
Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|Failed to execute '/bin/bash -c 'find "/Applications/Xcode.app/Contents/Developer/usr/bin" -type f | grep xcodebuild'': ExitStatus = 1
Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|find: /Applications/Xcode.app/Contents/Developer/usr/bin: No such file or directory

Sus*_*ver 8

在 Mac 上:

1)是否Xcode安装?

2)Xcode.app如果出现提示,请打开并接受许可证

3) 可选:运行xcode-select --install以安装 Xcode cmd-line 工具并在出现提示时接受许可

4)运行xcode-select -print-path以确保它指向的目录与Visual Studio中Xamarin iOS选项设置的目录相同,即

  /Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)

回复:https : //docs.microsoft.com/en-us/visualstudio/mac/installation

  • 等等,所以需要修改XCode的路径才能配对到Mac,但是只有配对到Mac才能修改路径?这听起来不太对,对吧? (2认同)

Ren*_* AD 7

在我的情况下,终端命令“xcode-select -print-path”告诉我 XCode 应用程序安装在文件夹中:“/Library/Developer/CommandLineTools”但将其添加到“工具 | 选项 | Xamarin | iOS 设置”不行。

我终于通过添加Xcode路径解决了它:/Applications/Xcode.app 配对到 mac XCode 路径

  • 更新到 Visual Studio 2019 v16.9 后出现此错误,这是我的修复方法 (2认同)