xcode8.3 shell 自动打包脚本
2017-06-05 22:56
357 查看
题记
xcode升级8.3后发现之前所用的xcode自动打包基本无法使用,因此在网上零碎找到些资料,将之前的脚本简化。此次脚本是基于xcode证书配置进行打包(之前是指定描述文件、相对繁琐)。因此代码较为简单使用。xcodebuild
自动打包是基于xcodebuild工具进行打包(xcode本身也是基于此打包)。在终端我们可以通过man xcodebuild指令查看了解xcodebuild工具
接着通过
xcodebuild --help可直接得到其使用示例
非cocoapods管理项目,只需要对单个工程进行打包处理,使用如下方法
xcodebuild [-project <projectname>] -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
由于笔者使用cocoapods管理第三方库,因此直接使用进行打包
xcodebuild -workspace <workspacename> -scheme <schemeName> [-destination <destinationspecifier>]... [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
当打包完成后只需要对压缩包解压即可得到对应的ipa安装包
xcodebuild -exportArchive -archivePath <xcarchivepath> -exportPath <destinationpath> -exportOptionsPlist <plistpath>
主要代码
#清理工程 xcodebuild clean -configuration ${development_mode} -quiet || exit #编译工程 xcodebuild archive -workspace ${project_name}.xcworkspace -scheme ${scheme_name} -configuration ${development_mode} -archivePath build/${project_name}.xcarchive -quiet || exit #打包 xcodebuild -exportArchive -archivePath build/${project_name}.xcarchive -configuration ${development_mode} -exportPath ${exportFilePath} -exportOptionsPlist ${exportOptionsPlistPath} -quiet || exit //todo ..应用上传分发操作 参数说明 cleaen 清理工程 quiet 不输出警告或错误 exit 命令未完成退出shell脚本 projectname 工程名 workspacename 工程名 schemeName 一般也为工程名(个人理解为应用调起标示) configuration 打包模式(Debug/Release) exportOptionsPlist ipa导出方式(分为app-store、ad-hoc、enterprise、development) 此项由plist文件构成的字典key:method, value:development(上述四个其中一个)
自动打包文件
自动打包脚本已上传至github有需要的朋友可自行下载自动打包脚本文件链接上述如有不妥之处请指正参考链接
相关文章推荐
- IOS 通过脚本自动打包工具 webfrogs/xcode_shell
- IOS 通过脚本自动打包工具 webfrogs/xcode_shell
- 【Xcode】Shell脚本自动打包ipa加企业版签名
- iOS开发进阶 - 使用shell脚本自动打包上传到fir.im上-b
- [iOS 自动打包]shell脚本使用-ipa_build 脚本使用
- IOS-自动打包Shell脚本(支持目录带空格)
- [转]iPhone多渠道自动打包Shell脚本介绍
- 一个自动打包并上传到远程FTP的shell脚本
- Maven 自动打包编译的shell脚本
- iOS利用(Shell脚本)自动打包项目工程生成ipa
- iOS配置shell脚本自动打包上传到蒲公英
- shell脚本从SVN下载项目并自动打包IPA和plist文件
- 几行shell帮你的xcode迅速自动批量打包ipa
- 升级到xcode9 shell脚本自动打包失败
- 【Java工具】java项目 Idea打包发布工具,自动生成bat sh 、shell 脚本
- 自动更新svn和打包ipa包 shell脚本
- shell脚本,用于自动构建xcode项目
- Xcode8.3.2 自动打包脚本
- iOS工程自动打包 (Shell脚本打包)
- xcodebuild自动打包脚本与自动上传蒲公英脚本