如何在 Xcode 7 中使用 xcodebuild 和手表扩展

2024-02-24

我们的命令以前是这样的

xcodebuild -configuration Release -target "xxx" -sdk iphoneos9.0 -scheme "xxx" archive

现在在 Xcode 7 中,我们收到此错误:

Build settings from command line:
    SDKROOT = iphoneos9.0

=== BUILD TARGET xxx WatchKit Extension OF PROJECT Mobile WITH CONFIGURATION Release ===

Check dependencies
target specifies product type 'com.apple.product-type.watchkit2-extension', but there's no such product type for the 'iphoneos' platform

我们如何指定使用iOS 9.0 SDK和watchos 2.0 SDK?


如果您需要构建模拟器,请运行以下命令:

xcodebuild -workspace WorkspaceName.xcworkspace -scheme SchemeWithWatchOS2Target -destination 'name=iPhone 6' build

如果您需要设备构建,请运行以下命令:

xcodebuild -workspace WorkspaceName.xcworkspace -scheme SchemeWithWatchOS2Target build

诀窍在于,对于任何构建,您都需要删除-sdk选项。对于模拟器构建,您需要指定-destination应该是iPhone 6 or iPhone 6 Plus。对于设备构建,您可以跳过-destination.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 Xcode 7 中使用 xcodebuild 和手表扩展 的相关文章

随机推荐