使用 xcodebuild、swift 包管理器、iOS 17 和 swift-confidential 编译失败

问题描述 投票:0回答:1

我的应用程序使用库 swift-confidential(用于混淆 Swift 文字的工具)从 Xcode IDE 正确编译、验证和存储。

但是我无法在我的 osx 服务器上使用 Xcode,所以我需要使用 xcodebuild,我总是使用环境变量成功编译我的应用程序...

我已经使用 SPM 安装了两个库,都到了 0.3.0 版本。一切都在 Xcode IDE 上运行得很好。

我的提示命令:

# remove all old settings
defaults delete com.apple.dt.Xcode
# skip plugin SDK validation requirement
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES
defaults write com.apple.dt.Xcode IDESkipPackagePluginValidation -bool YES

xcodebuild -workspace "$PROJECT_PATH" -scheme "MYAPP" -skipPackagePluginValidation -configuration 
'Release' DEVELOPMENT_TEAM="$DEVELOPER_TEAM" PROVISIONING_PROFILE=$COMPOSE_PROFILE  
CODE_SIGN_IDENTITY="$CERT_ID_DISTRIBUTION" build

其中 $PROJECT_PATH 和其他环境变量设置正确。

这是错误:

/Users/cm/Library/Developer/Xcode/DerivedData/MYAPP-aiforaavtwmmlzduwibsbgvwnosl/SourcePackages/checkouts/
swift-confidential-plugin/Package.swift: error: Bundle identifier is missing. Confidential doesn't have a 
bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 
'Confidential' from project 'swift-confidential-plugin')
** BUILD FAILED **

[1;31m Error: ATTENZIONE: Il comando [xcodebuild -workspace "MYAPP.xcworkspace" -scheme "MYAPP" build] ha restituito il seguente Error Code [65] [0m
[[1;31mERROR[m] Command execution failed.

似乎

xcodebuild
不会跳过检查插件库,因为我在构建启动之前和期间通过
-skipPackagePluginValidation
命令设置的命令告诉它这样做。

我应该添加哪些其他内联命令以避免检查此 spm 插件?

swift xcodebuild swift-package-manager ios17 swift-confidential
1个回答
0
投票

为了以防万一,作为解决方法,您可以尝试直接在 xcodebuild 命令中为

PRODUCT_BUNDLE_IDENTIFIER
添加
swift-confidential-plugin

xcodebuild -workspace "$PROJECT_PATH" -scheme "MYAPP" -configuration 'Release' \
DEVELOPMENT_TEAM="$DEVELOPER_TEAM" PROVISIONING_PROFILE="$COMPOSE_PROFILE" \
CODE_SIGN_IDENTITY="$CERT_ID_DISTRIBUTION" \
PRODUCT_BUNDLE_IDENTIFIER="com.yourcompany.swiftconfidential" build

捆绑包标识符可以来自您的

MYAPP.xcworkspace
,或来自每个目标的
Info.plist
文件,并带有与
CFBundleIdentifier
键关联的标识符。 PListBuddy 可以提供帮助(
/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" /path/to/Info.plist
grep -A1 CFBundleIdentifier /path/to/Info.plist | tail -n1

对于像

swift-confidential
这样的 Swift 包,如果它是一个库,则可能不会显式设置包标识符。然后做一个像
com.yourcompany.swiftconfidential

© www.soinside.com 2019 - 2024. All rights reserved.