为了能到远方,脚下的每一步都不能少.|

园龄:粉丝:关注:

使用命令行编译xcode项目并加入版本信息

xcodebuild -workspace ${SOLUTION_NANE} -scheme ${SCHEME_NAME}  -configuration ${BUILD_CONFIRUATION} 

example:

xcodebuild -workspace Test -scheme translate  -configuration Release

那么如何查看你的工作空间有哪些scheme呢

先cd到工作空间目录下

xcodebuild -list

显示内容

Information about project "MakeFileTest":
    Targets:
        MakeFileTest

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        MakeFileTest

如果想要添加版本信息

echo 获取git版本号
svnInfoResult=`git rev-list HEAD --count`
svnVersion=${svnInfoResult##* }
DYLIB_CURRENT_VERSION="1.1.${svnVersion}"
DYLIB_COMPATIBILITY_VERSION="1.0.1"
GCC_PREPROCESSOR_DEFINITIONS="LIB_VERSION=\\\"${DYLIB_CURRENT_VERSION}\\\""



echo 编译代码

BUILD_SETTING=" -configuration $CONFIG DYLIB_CURRENT_VERSION=${DYLIB_CURRENT_VERSION} DYLIB_COMPATIBILITY_VERSION=${DYLIB_COMPATIBILITY_VERSION} GCC_PREPROCESSOR_DEFINITIONS=${GCC_PREPROCESSOR_DEFINITIONS} build"
xcodebuild -workspace ${SOLUTION_NANE} -scheme ${SCHEME_NAME}  ${BUILD_SETTING}

DYLIB_CURRENT_VERSION表示当前版本

DYLIB_COMPATIBILITY_VERSION 表示最低兼容版本

example:

xcodebuild -workspace Test -scheme translate  ${BUILD_SETTING}

还可以单独编译项目

  xcodebuild -project translate.xcodeproj -target translate ${BUILD_SETTING}

本文作者:乘舟凉

本文链接:https://www.cnblogs.com/czlnb/p/15796051.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   乘舟凉  阅读(245)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起