我正在尝试使用 Xcode 12 beta 4 构建一个支持 Apple Silicon 和 Mac Catalyst 的框架。该项目在 Xcode 中使用“Any Mac”目标构建得很好。如果我使用命令
xcodebuild -project "project.xcodeproj" -configuration "Release" -scheme "MyScheme" -destination "generic/platform=macOS,variant=Mac Catalyst,name=Any Mac"
我得到错误
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ generic:1, platform:macOS, variant:Mac Catalyst, name:Any Mac }
Unsupported device specifier option.
The device “My Mac” does not support the following options: name
Please supply only supported device specifier options.
...
Ineligible destinations for the "MyScheme" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:macOS, variant:Mac Catalyst, name:Any Mac }
我不确定为什么目的地在 Xcode 中正确构建时被列为不合格,或者为什么 xcodebuild 在启用通用时似乎使用“我的 Mac”设备。如何使用 xcodebuild 在 Apple Silicon 上构建 Mac Catalyst?