iOS 代码自动打包上传脚本

背景小介绍

xcodebuild xcode 提供的命令行工具,用于build 工程或者工作空间,具体的用法可以在终端中输入 man xcodebuild.本次我们主要使用
xcodebuild [-project name.xcodeproj] [[-target targetname] … | -alltargets] [-configuration configurationname] [-sdk [sdkfullpath | sdkname]] [action …] [buildsetting=value …] [-userdefault=value …]

  • shenzhen 主要用于 ipa 包的提交,当然他有很多功能更,这里我只用了一点点而已,更多的使用可以参见github 地址.
    下面直接上命令了

  • 生成 archive 文件

“xcodebuild -quiet -workspace XXX.xcworkspace -scheme XXXXX -sdk iphoneos -configuration Release archive -archivePath $PWD/build/XXXXX.xcarchive
-quiet 让控制台尽量少的输出日志
-workspace XXX.xcworkspace 需要 build 的 workspace,不是必须参数
-scheme XXXXX build 指定的 scheme, 如果是 build workspace那么这个参数是必须的
-sdk [sdkfullpath | sdkname] Build an Xcode project or workspace against the specified SDK, using build tools appropriate for that SDK. The argument may be an absolute path to an SDK, or the canonical name of an SDK.
-configuration configurationname Use the build configuration specified by configurationname when building each target.
-archivePath -archivePath xcarchivepath Specifies the path for the archive produced by the archive action, or specifies the archive that should be exported when -exportArchive is passed.
这时候可以在./ build 文件夹下面看到 XXX.xcarchive 文件了

生成 ipa 包(这里利用的 shenzhen)

xcodebuild -quiet -exportArchive -archivePath PWD/bui

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值