【问题标题】:xcodebuild ignoring -derivedDataPathxcodebuild 忽略 -derivedDataPath
【发布时间】:2021-09-30 18:15:28
【问题描述】:

我是否误解了-derivedDataPath 的作用,或者这是一个错误?您可以在输出中清楚地看到 xcodebuild 忽略了命令行值,并默认为 Library/Developer/Xcode/DerivedData

Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project MyProj.xcodeproj -scheme “MyProj (iOS)" -destination "name=iPhone 12" -derivedDataPath=/Users/alpe77/myproj/MyProj/Build build

User defaults from command line:
    derivedDataPath = /Users/alpe77/myproj/MyProj/Build
    IDEPackageSupportUseBuiltinSCM = YES

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Using build description from disk
note: Build preparation complete
CodeSign /Users/alpe77/Library/Developer/Xcode/DerivedData/MyProj-aozsidihjyumkvevtfoqflhumohn/Build/Products/Debug-iphonesimulator/MyProj.app (in target 'MyProj (iOS)' from project 'MyProj')
cd /Users/alpe77/myproj/MyProj
export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

Signing Identity:     "-"

/usr/bin/codesign --force --sign - --entitlements 
/Users/alpe77/Library/Developer/Xcode/DerivedData/MyProj-aozsidihjyumkvevtfoqflhumohn/Build/Intermediates.noindex/MyProj.build/Debug-iphonesimulator/MyProj\ \(iOS\).build/MyProj.app.xcent --timestamp\=none 
/Users/alpe77/Library/Developer/Xcode/DerivedData/MyProj-aozsidihjyumkvevtfoqflhumohn/Build/Products/Debug-iphonesimulator/MyProj.app
/Users/alpe77/Library/Developer/Xcode/DerivedData/MyProj-aozsidihjyumkvevtfoqflhumohn/Build/Products/Debug-iphonesimulator/MyProj.app: replacing existing signature

** BUILD SUCCEEDED ** [0.771 sec]

% xcrun xcodebuild -version 
Xcode 12.5.1
Build version 12E507

【问题讨论】:

    标签: xcodebuild


    【解决方案1】:

    遇到同样的问题(Xcode 12.4),发现构建环境配置变量CONFIGURATION_BUILD_DIR覆盖了-derivedDataPath中给出的路径

    我打开“Xcode Preferences > Locations > Derived Data > Advanced”并将构建位置设置从我的自定义设置更改为“Unique”,从而解决了问题。

    对如何防止CONFIGURATION_BUILD_DIR 在命令行上覆盖-derivedDataPath 感兴趣,不过...

    编辑

    请参阅https://stackoverflow.com/a/35662727/403750 以获得解决方案。

    【讨论】:

    • xcodebuild 运行时查看CONFIGURATION_BUILD_DIR 的值的一种方法是添加-showBuildSettings 命令行选项。
    猜你喜欢
    • 2023-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多