xcodebuild命令
一、xcodebuild命令介绍
1.基本命令
查看xcodebuild简洁用法
xcodebuild -usage
查看已安装的SDK
xcodebuild -showsdks
查看安装的版本号
xcodebuild
-version
[-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]查看项目中的Targets、Configurations和Schemes
xcodebuild
-list
[[-project <projectname>]|[-workspace <workspacename>]]Archive
xcodebuild
archive -archivePath <archivePath>
-project <projectName>
-scheme <schemeName> #从-list命令中获取
-configuration < Debug|Release>
-sdk <sdkName> #sdkName可从showsdks命令中获取
导出Archive
xcodebuild
-exportArchive
-archivePath <xcarchivepath>
-exportPath <destinationpath>
-exportOptionsPlist <plistpath>#这个plist文件可以通过打一次ipa包里面去获取,然后根据需求修改exportLocalizations
xcodebuild
-exportLocalizations
-localizationPath <path>
-project <projectname>
[-exportLanguage <targetlanguage>...]importLocalizations
xcodebuild
-importLocalizations
-localizationPath <path>
-project <projectname>
2.可选命令
可选命令 | 命令说明 |
-usage | 查看xcodebuild简洁的用法 |
-help | 查看帮助 |
-verbose | 提供额外的状态输出 |
-license | 显示Xcode和SDK许可协议 |
-checkFirstLaunchStatus | 检查是否有任何初启动任务需要执行 |
-project NAME | 编译项目名称,例如:xcodebuild -project XXX.xcodeproj |
-target NAME | 编译目标名称 |
-targets | 编译全部目标 |
-workspace NAME | 编译工作空间名称 |
-scheme NAME | 编译计划名称 |
-configuration NAME | 为构建每一个目标使用build配置名称 |
-xcconfig PATH | 在PATH作为替代应用文件中定义的构建设置 |
-arch ARCH | 建立每个目标的架构ARCH;这将覆盖在项目中定义的架构 |
-sdk SDK | 使用指定的SDK编译项目 |
-toolchain NAME | 使用工具链与标识或名称 |
-destination DESTINATIONSPECIFIER | 使用由目标说明(用逗号分隔的一系列的key =描述目的地使用值对)中描述的目的地 |
-destination-timeout TIMEOUT | 等待TIMEOUT秒,而搜索的目标设备 |
-parallelizeTargets | 建立并行独立目标 |
-jobs NUMBER | 指定并发生成操作的最大数量 |
-dry-run | 做一切,除了实际运行的命令 |
-hideShellScriptEnvironment | 不显示在构建日志shell脚本中的环境变量 |
-showsdks | 显示已安装的SDK的列表 |
-showBuildSettings | 显示构建设置和值的列表 |
-list | 列出了在一个工作空间中的一个项目的目标和配置,或方案 |
-find-executable NAME | 在所提供的SDK和工具链显示的完整路径可执行文件名称 |
-find-library NAME | 在所提供的SDK和工具链显示的完整路径库名 |
-version | 显示的Xcode的版本;与-sdk将显示一个或所有已安装的SDK信息 |
-enableAddressSanitizer YES/NO | 测试时打开或关闭地址过滤 |
-resultBundlePath PATH | 指定在描述什么发生了捆绑的结果将被放置的目录 |
-derivedDataPath PATH | 指定的目录中生成产品和其他衍生数据会 |
-archivePath PATH | 被指定任何创建的档案将被放置的目录,或应导出存档 |
-exportArchive | 指定归档应导出 |
-exportOptionsPlist PATH | 指定用于配置归档导出plist文件的路径 |
-enableCodeCoverage YES/NO | 打开代码覆盖率或关闭时的测试 |
-exportPath PATH | 指定从存档导出的产品的目标 |
-skipUnavailableActions | 指定不能执行计划的行动应被跳过而不是导致失败 |
-exportLocalizations | 出口完成优秀项目本地化 |
-importLocalizations | 进口本地化项目,假设任何必要的本地化资源在Xcode中已创建 |
-localizationPath | 指定XLIFF本地化文件路径 |
-exportLanguage | 规定包括在本地化出口多个可选ISO 639-1语言 |
3.exportOptionsPlist文件内容配置说明
Key | 类型 | value | 说明 |
compileBitcode | Bool | For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to YES | 对于非App Store的出口,应重新编译Xcode中从bitcode应用程序?默认为YES |
embedOnDemandResources AssetPacksInBundle |
Bool | For non-App Store exports, if the app uses On Demand Resources and this is YES, asset packs are embedded in the app bundle so that the app can be tested without a server to host asset packs. Defaults to YES unless onDemandResourcesAssetPacksBaseURL is specified | 对于非App Store的出口,如果应用程序使用按需的资源,这是YES,资产包被嵌入在应用程序包,使应用程序可以在没有服务器托管资产包进行测试。默认为YES除非指定onDemandResourcesAssetPacksBaseURL |
iCloudContainerEnvironment | For non-App Store exports, if the app is using CloudKit, this configures the "com.apple.developer.icloud-container-environment" entitlement. Available options: Development and Production. Defaults to Development | 对于非App Store的出口,如果应用程序使用CloudKit,这种配置“com.apple.developer.icloud容器环境”的权利。可用选项:开发和生产。默认为发展 | |
manifest | Dictionary | For non-App Store exports, users can download your app over the web by opening your distribution manifest file in a web browser. To generate a distribution manifest, the value of this key should be a dictionary with three sub-keys: appURL, displayImageURL, fullSizeImageURL. The additional sub-key assetPackManifestURL is required when using on demand resources | 对于非App Store的出口,用户可以通过在Web浏览器中打开您的分发清单文件下载你的应用程序在网上。要生成分布明显,此键的值应该是有三个子键的字典:appURL,displayImageURL,fullSizeImageURL。额外的子键assetPackManifestURL是按需使用资源时,需要。 |
method | String | Describes how Xcode should export the archive. Available options: app-store, ad-hoc, package, enterprise, development, and developer-id. The list of options varies based on the type of archive. Defaults to development | Xcode中描述如何导出存档。可用选项:应用程序商店,即席,包装,企业发展,开发人员ID。选项列表会有所不同根据存档的类型。默认为发展 |
onDemandResourcesAssetP acksBaseURL |
String | For non-App Store exports, if the app uses On Demand Resources and embedOnDemandResourcesAssetPacksInBundle isn't YES, this should be a base URL specifying where asset packs are going to be hosted. This configures the app to download asset packs from the specified URL | 对于非App Store的出口,如果应用程序使用按需资源embedOnDemandResourcesAssetPacksInBundle不是YES,这应该是一个基本URL指定,其中资产包将要举行。该配置应用从指定的URL下载资产包 |
teamID | String | The Developer Portal team to use for this export. Defaults to the team used to build the archive | 开发者门户网站团队使用这个出口。默认为球队用来建立档案 |
thinning | String | For non-App Store exports, should Xcode thin the package for one or more device variants? Available options: <none> (Xcode produces a non-thinned universal app), <thin-for-all-variants> (Xcode produces a universal app and all available thinned variants), or a model identifier for a specific device (e.g. "iPhone7,1"). Defaults to <none> | 对于非App Store的出口,Xcode中应该薄包一个或多个设备的变种?可用选项:<无>(Xcode中产生的非变薄普遍的应用程序),<薄参加的所有变体>(Xcode中产生一个通用的应用程序以及所有可用的变薄变型),或针对特定设备型号标识(例如“ iPhone7,1“)。默认为<无> |
uploadBitcode | Bool | For App Store exports, should the package include bitcode? Defaults to YES | 对于App Store的导出,应包包括bitcode?默认为YES |
uploadSymbols | Bool | For App Store exports, should the package include symbols? Defaults to YES | 对于App Store的出口,应包包含符号?默认为YES |
二、xcodebuild命令实际应用
1.清除编译过程生成文件
xcodebuild clean
-workspace <xxx.workspace>
-scheme <schemeName>
-configuration <Debug|Release>
-sdk<sdkName>
2.编译命令
xcodebuild build
-workspace <xxx.workspace>
-scheme <schemeName>
-configuration <Debug|Release>
-sdk<sdkName>
3.编译并生成.xcarchive包
xcodebuild archive
-archivePath <archivePath> #生成的.xcarchive包存放路径
-workspace <XXX.xcworkspace>
-scheme <schemeNmae>
-configuration <Debug|Release>
-sdk <sdkName>
4.生成的.archive包导出成ipa文件
xcodebuild -exportArchive
-archivePath <archivePath> #.archive文件的全路径 eg: .../.../XXX.xcarchive
-exportPath <exportPath> #ipa文件导出路径
-exportOptionsPlist <exportOptionsPlistPath> #exportOptionsPlist文件全路径 eg: .../.../XXX.plist
exportOptionsPlist文件示例:详细配置请参考上面exportOptionsPlist文件内容配置说明
<?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>
<key>provisioningProfiles</key>
<dict>
<key>com.669.yanyou</key>
<string>yanyou_dev</string>
</dict>
<key>signingCertificate</key>
<string>F13EE282147D6ED2CD5ACEEF20476B39C87AEAAC</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>HW9U4B8YY9</string>
<key>thinning</key>
<string><none></string>
</dict>
</plist>
苹果官方xcodebuild命令文档
xcodebuild命令的更多相关文章
- 了解 xcodebuild 命令 ,自动打包ipa
引用博客:http://blog.nswebfrog.com/2015/10/31/xcodebuild/ 在 iOS 开发中,如果需要把工程打包成 ipa 文件,通常的做法就是在 Xcode 里点击 ...
- iOS利用xcodebuild命令自动打包方法
1,xcode项目先打包试一下可以打包成功 2,创建一plist导出文件 3,xcodebuild命令直接运行 导出文件内容: <?xml version="1.0" enc ...
- Xcodebuild命令使用
Xcodebuild简介 Xcodebuild是命令行工具包的其中一项. 命令行工具包(Command Line Tools)是一个轻量的.可以与XCode分开的.在Mac上单独下载的命令行工具包. ...
- xcodebuild命令行打包发布ipa
配置好证书,然后在命令行转到项目目录 1.清除 EthantekiiMac:CTest ethan$ xcodebuild clean 2.编译 EthantekiiMac:CTest ethan$ ...
- iOS Xcodebuild
简介 xcodebuild 是苹果发布自动构建的工具.它在一个Xcode项目下能构建一个或者多个targets ,也能在一个workspace或者Xcode项目上构建scheme,总的来说,用它没错就 ...
- xcodebuild导出ipa方法
xcode 5.x版本导出ipa是不需要开发者账号,而xcode6以后导出ipa必须要求选择开发者team,无法绕开,但我们使用xcodebuild命令行可以无视这个限制 环境: mac osx 10 ...
- iOS 应用打包命令一览
文章转载自:http://www.jianshu.com/p/5d59966eaecc 文章排版部分根据自己的理解做了一些修改. 各种命令的简介 使用命令打包iOS 应用一般会用到 xcodebuli ...
- iOS 命令行打包--xcworkspace
参考: 打包的具体操作步骤: https://www.jianshu.com/p/6a0aa8cd2e97 打包时使用到的参数详解,参考这篇: https://debugtalk.com/post/i ...
- tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
在执行自动化打包的时候报错,检查发现是Xcode的路径被改了 标记3的地方原来默认是没有内容的,点击它,然后会自动弹出一个选项,就是xcode的版本. 修改后,在命令行输入xcodebuild命令测试 ...
随机推荐
- BZOJ2276:[POI2011]Temperature
浅谈队列:https://www.cnblogs.com/AKMer/p/10314965.html 题目传送门:https://lydsy.com/JudgeOnline/problem.php?i ...
- Linux评估 CPU使用情况
评价参数 1)CPU utilization:最直观最重要的就是CPU的使用率.如果长期超过80%,则表明CPU遇到了瓶颈:2)User time: 用户进程使用的CPU:该数值越高越好,表明越多的C ...
- c# Chart 服务器端动态创建ChartArea
1 aspx <x:ContentPanel ShowBorder="true" ShowHeader="false" ID="ContentP ...
- 获取APK的package名和activity名
使用 aapt dump badging + 需要安装的APK
- __cdecl & __stdcall calling conventions
(一) __cdecl: c declaration C语言默认的函数调用方法:所有参数从右到左依次入栈,这些参数由调用者清除,称为手动清栈.C/C++默认的调用方式,可用于函数参数不确定的情况下. ...
- sql语句优化方案
1. 为查询缓存优化你的查询 NOW() 和 RAND() 或是其它的诸如此类的SQL函数都不会开启查询缓存,因为这些函数的返回是会不定的易变的. 所以,你所需要的就是用一个变量来代替MySQL的函数 ...
- rsync 简单使用 非默认ssh端口 分别从远程获取及推送本地的文件到远程
rsync: did not see server greetingrsync error: error starting client-server protocol (code 5) at mai ...
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 85
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 85;import sys reload(sys) sys.s ...
- Github中README.md换行
两个以上的空格,然后回车.我date
- 5-EasyNetQ之Publish(黄亮翻译)
EasyNetQ支持的最简单的消息模式是发布/订阅.这个模式是一个极好的方法用来解耦消息提供者和消费者.消息发布者只要简单的对世界说,"这里有些事发生" 或者 "我现在有 ...