用 xcodebuild 自动化打包

其实也就三个步骤,但是就是这三个步骤也算是爬坑爬出来的。   现在用xcode 8.3 版本的,里面很多都更新了,而苹果的xcodebuild用法还没有更新。所以就自己找找网上的一个一个试出来的。闲话不说了,上干货。。。。。。


自己工程用到的:


1.清空工程

xcodebuild -project $Project_Path -configuration Release -target $targerName clean


2.编译

xcodebuild archive -project $Project_Path -configuration Release -scheme $targerName -archivePath ${compiled_path}/${platformname}.xcarchive CODE_SIGN_IDENTITY=$signing PROVISIONING_PROFILE=$profileUuid


3.打包

xcodebuild -exportArchive -archivePath ${compiled_path}/${platformname}.xcarchive -exportPath ${ipa_path}/test.ipa -exportOptionsPlist ${TargetPath}/exportConfig.plist


说一下里面的含义吧


$Project_Path:工程路径

$targerName: 工程里面target的名称

$signing: "打包证书的名称" 

$profileUuid:打包配置的uuid


exportConfig.plist写的内容为:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>method</key>
<string>development</string>
</dict>
</plist>


method有4种:development,app-store,ad-hoc,enterprise   主要就是打出四种包的方式


xcodebuild的主要介绍可以参考:

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html


xcodebuild的运用可以参考:

http://blog.csdn.net/potato512/article/details/52172107






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值