ios - xcodebuild存档失败:选择错误的SDK?

标签 ios xcode xcodebuild fastlane

我正在使用faSTLane发布应用程序。用于构建应用程序的xcodebuild命令的简化版本是这样的:

xcodebuild -workspace App.xcworkspace -scheme App 
           -configuration Release -sdk iphoneos13.6 
           -destination 'generic/platform=iOS' clean archive
这无法给出(添加示例):
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from /Users/sudeepkumar/Zendrive/mobile-apps/ios/copilot/Pods/glog/src/symbolize.cc:55:
In file included from /Users/sudeepkumar/Zendrive/mobile-apps/ios/copilot/Pods/glog/src/utilities.h:73:
In file included from /Users/sudeepkumar/Zendrive/mobile-apps/ios/copilot/Pods/glog/src/base/mutex.h:141:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
 ^
我看到它正在选择MacOSX.sdk,我希望它会选择Xcode目录中存在的iPhoneOS sdk。这是失败的原因吗?或者是其他东西?
xcrun输出:
» xcrun --show-sdk-platform-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform

» xcrun --sdk iphoneos --show-sdk-platform-path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform

最佳答案

Xcode正在/Library/CommandLineTools中使用SDK。相反,它应该在Xcode应用程序内部使用它们。跑

 xcode-select -r
要么
xcode-select -s "/Applications/Xcode.app/Contents/Developer"
验证人
xcode-select -p
其中一些可能需要sudo

关于ios - xcodebuild存档失败:选择错误的SDK?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63627237/

相关文章:

ios - 移动广告网络如何在不需要修改广告应用程序的情况下跟踪应用程序安装?

iphone - iOS:如何将不使用后台音频、Voip、GPS 的应用程序保留在后台?

ios - SWIFT 无限动画/函数调用循环

xcode - 预期声明 Swift(Sprite Kit)

C++ - 如何在 lldb/Xcode 中获取 std::vector 对象的地址

ios - Xcode 11 : ERROR: Identical key for two renditions

macos - xcodebuild - 如何指定项目所在的目录,而不在其中做 cd

xcode4 - xcodebuild 使用哪个版本的 Xcode?

ios - 变换 UIView 形状

ios - 在 xcode 模拟器中构建时禁用 RealityKit/ARKit