【发布时间】:2019-12-27 08:10:15
【问题描述】:
选择 watchOS 目标时,我的 Swift 包编译失败。
错误消息是Failed to load module 'XCTest',构建错误详细信息是:
/Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator6.0.sdk/usr/lib/swift/XCTest.swiftmodule/i386.swiftinterface:6:19: XCTest is not available when building for watchOS Simulator. Consider using#if targetEnvironment(macCatalyst)to conditionally import this framework when building for Mac Catalyst.
watchOS 中没有 XCTest,所以我要让我的 Swift 包为 watchOS 编译吗?
【问题讨论】:
-
你好@TruMan1,你找到解决办法了吗?
-
不,这仍然是一个问题,不幸的是,我用
#if !os(watchOS)包装了我所有的测试。
标签: swift xctest watchos swift-package-manager