5

Xcodebuild 使用注意事项

 2 years ago
source link: http://douxinchun.github.io/blog/20180516/xcodebuild-shi-yong-zhu-yi-shi-xiang.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Xcodebuild 使用注意事项

2018 年5 月16 日 11:17 am | Comments

1.xcodebuild cocoapod CONFIGURATION_BUILD_DIR

xcodebuild命令用法示例

xcodebuild -sdk iphoneos -configuration ${BUILD_CONFIGURATION} -derivedDataPath="../build" -workspace '../SohuInk.xcworkspace' -scheme 'SohuInk_Jenkins' -archivePath "../SohuInk_Jenkins.xcarchive" archive

如果项目中使用了cocoapod并且xcodebuild 命令参数中指定了CONFIGURATION_BUILD_DIR并且值为相对路径,此时在Xcode Tools Version 5.0下的xcodebuild构建会报如下错误:

error_info

ld: warning: directory not found for option '-L/XXXX/XXXX/pop'
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **

The following build commands failed:
  Ld /Users/XXXX/XXXX/Objects-normal/arm64/SohuInk normal arm64
  Ld /Users/XXXX/XXXX normal armv7
(2 failures)

方案1,不好用

Xcode Tools version 5.0 支持参数 derivedDataPath 可以放弃CONFIGURATION_BUILD_DIR配置指定该参数,我实际操作是发现使用相对路径的情况下,虽然可以archive success,但是build的目录没有改变,依然在xcode默认的derivedData目录下.

方案2,OK

CONFIGURATION_BUILD_DIR的值指定为绝对路径,一切OK,可成功archive.

xcodebuild中的CONFIGURATION_BUILD_DIR值需要使用绝对路径

Stackoverflow上关于使用xcodebuild CONFIGURATION_BUILD_DIR最好使用绝对路径的说明 @Chilloutman
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html

Posted by Spring

2018 年5 月16 日 11:17 am

xcode, xcodebuild

« Mac Terminal 快捷键记录 低版本Xcode调试高版本的iOS系统 »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK