iOS开发进阶(十四):xcodebuild 命令应用详解_xcodebuild命令详解

最后

我可以将最近整理的前端面试题分享出来,其中包含HTML、CSS、JavaScript、服务端与网络、Vue、浏览器、数据结构与算法等等,还在持续整理更新中,希望大家都能找到心仪的工作。

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

篇幅有限,仅展示部分截图:

查看项目中的TargetsConfigurationsSchemes

xcodebuild
-list
[[-project <projectname>]|[-workspace <workspacename>]] 

在这里插入图片描述

清除编译过程生成文件

xcodebuild clean
-workspace <xxx.workspace>
-scheme <schemeName>
-configuration <Debug|Release>
-sdk<sdkName>

编译命令:

xcodebuild build
-workspace <xxx.workspace>
-scheme <schemeName>
-configuration <Debug|Release>
-sdk<sdkName>

编译并生成.xcarchive包:

xcodebuild archive
-archivePath <archivePath> #生成的.xcarchive包存放路径
-workspace <XXX.xcworkspace>
-scheme <schemeNmae> #从-list命令中获取
-configuration <Debug|Release>
-sdk <sdkName> #sdkName可从showsdks命令中获取

将生成的.archive包导出成ipa文件:

xcodebuild  -exportArchive
-archivePath <archivePath> #.archive文件的全路径 eg: .../.../XXX.xcarchive
-exportPath <exportPath> #ipa文件导出路径
-exportOptionsPlist <exportOptionsPlistPath> #exportOptionsPlist文件全路径 eg: .../.../XXX.plist,这个plist文件可以通过打一次ipa包里面去获取,然后根据需求修改

三、xcodebuild 可选命令

xcodebuild可选命令如下:

| 可选命令 | 命令说明 |
| -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语言 |

四、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: (Xcode produces a non-thinned universal app), (Xcode produces a universal app and all available thinned variants), or a model identifier for a specific device (e.g. “iPhone7,1”). Defaults to | 对于非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 |

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/>
#### 总结一下



面试前要精心做好准备,简历上写的知识点和原理都需要准备好,项目上多想想难点和亮点,这是面试时能和别人不一样的地方。

还有就是表现出自己的谦虚好学,以及对于未来持续进阶的规划,企业招人更偏爱稳定的人。

**[开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】](https://bbs.csdn.net/topics/618166371)**

万事开头难,但是程序员这一条路坚持几年后发展空间还是非常大的,一切重在坚持。



为了帮助大家更好更高效的准备面试,特别整理了《前端工程师面试手册》电子稿文件。

![](https://img-blog.csdnimg.cn/img_convert/621960a57eb42479e02d6d64c0c81891.png)



![](https://img-blog.csdnimg.cn/img_convert/5230c48fd0fcb265f3401a21603bda2b.png)



**前端面试题汇总**



![](https://img-blog.csdnimg.cn/img_convert/42728594459506983a38ca2b86545fc6.png)

**JavaScript**



![](https://img-blog.csdnimg.cn/img_convert/7796de226b373d068d8f5bef31e668ce.png)



**性能**

![](https://img-blog.csdnimg.cn/img_convert/d7f6750332c78eb27cc606540cdce3b4.png)



**linux**



![](https://img-blog.csdnimg.cn/img_convert/ed368cc25284edda453a4c6cb49916ef.png)



**前端资料汇总**

![](https://img-blog.csdnimg.cn/img_convert/6e0ba223f65e063db5b1b4b6aa26129a.png)

前端工程师岗位缺口一直很大,符合岗位要求的人越来越少,所以学习前端的小伙伴要注意了,一定要把技能学到扎实,做有含金量的项目,这样在找工作的时候无论遇到什么情况,问题都不会大。



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值