【发布时间】:2021-06-17 23:38:00
【问题描述】:
我正在尝试使用 xcodebuild 为我的 Swift 包(由 Package.swift 定义)运行测试:
xcodebuild -scheme "package-name-Package" -configuration "Debug" -sdk "iphonesimulator14.5" -arch "x86_64" test`
不幸的是,我不断收到此错误:
xcodebuild: error: Failed to build workspace package-name with scheme package-name-Package.
Reason: Cannot test target “Target1Tests” on “Any iOS Simulator Device”: Tests must be run on a concrete device
Cannot test target “Target2Tests” on “Any iOS Simulator Device”: Tests must be run on a concrete device
Cannot test target “Target3Tests” on “Any iOS Simulator Device”: Tests must be run on a concrete device
我不确定要使用什么 -sdk。我已经阅读了xcodebuild -showsdks 的输出并进行了适当的选择(我需要为 iOS 构建/测试)。我试过iphoneosiphonesimulator,iphoneos15.0,iphonesimulator15.0,iphonesimulator14.5,iphoneos14.5作为sdk。 (Xcode 12 和 Xcode 13 测试版,使用 xcode-select)
【问题讨论】:
标签: xcode xcodebuild