转自:简书

IOS 命令行编译

 

发表于 IOS2013-08-17 07:07 字数: 583 阅读量: 61

This document will note about the ios command build steps.

Step1: Sync code

You can use git svn or other vc tools sync you code to local disk. Then change the current dir to project dir that exist example.xcodeproj file.

Step2: Update project version

first you can use command:

  1. $ agvtool what-version

if the output have a number this step can be skiped.

if the output have no number user follow commamd update project version

  1. $ agvtool new-marketing-version 1.2
  2. $ agvtool new-version -all 1.2

Step3: Unlock keychian

You can use follow command do this step

  1. security list-keychains -s ~/Library/Keychains/login.keychain
  2. security default-keychain -d user -s ~/Library/Keychains/login.keychain
  3. security unlock-keychain -p password ~/Library/Keychains/login.keychain

If you undo this step, you next step maybe failed.

Step4: Build IOS Project

We will use commad xcodebuild build the ios project.

You can use follow command get help for this command

  1. $ xcodebuild -h
  2. Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  3. xcodebuild [-project <projectname>] -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  4. xcodebuild -workspace <workspacename> -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
  5. xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
  6. xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
  7. xcodebuild -showsdks
  8. Options:
  9. -usage print brief usage
  10. -help print complete usage
  11. -verbose provide additional status output
  12. -license Show License agreement!
  13. -project NAME build the project NAME
  14. -target NAME build the target NAME
  15. -alltargets build all targets
  16. -workspace NAME build the workspace NAME
  17. -scheme NAME build the scheme NAME
  18. -configuration NAME use the build configuration NAME for building each target
  19. -xcconfig PATH apply the build settings defined in the file at PATH as overrides
  20. -arch ARCH build each target for the architecture ARCH; this will override architectures defined in the project
  21. -sdk SDK use SDK as the name or path of the base SDK when building the project
  22. -toolchain NAME use the toolchain with identifier or name NAME
  23. -parallelizeTargets build independent targets in parallel
  24. -jobs NUMBER specify the maximum number of concurrent build operations
  25. -dry-run do everything except actually running the commands
  26. -showsdks display a compact list of the installed SDKs
  27. -showBuildSettings display a list of build settings and values
  28. -list lists the targets and configurations in a project, or the schemes in a workspace
  29. -find-executable NAME display the full path to executable NAME in the provided SDK and toolchain
  30. -find-library NAME display the full path to library NAME in the provided SDK and toolchain
  31. -version display the version of Xcode; with -sdk will display info about one or all installed SDKs

Show current xcodebuild version

  1. $ xcodebuild -version
  2. Xcode 4.5.2
  3. Build version 4G2008a

Show current SDK

  1. $ xcodebuild -showsdks
  2. OS X SDKs:
  3. Mac OS X 10.7 -sdk macosx10.7
  4. OS X 10.8 -sdk macosx10.8
  5. iOS SDKs:
  6. iOS 6.0 -sdk iphoneos6.0
  7. iOS Simulator SDKs:
  8. Simulator - iOS 6.0 -sdk iphonesimulator6.0

Show project information in project folder

  1. $ xcodebuild -list

Build project via iOS 6.0 sdks

  1. $ xcodebuild -sdk iphoneos6.0

or command

  1. $ xcodebuild clean -sdk iphoneos6.0 -configuration Release

Step5: Generate ipa file

This step will generate the ipa file.

Will use follow command to finish this step:

  1. $ xcrun -sdk iphoneos6.0 PackageApplication -v your/target/app/path.app -o your/output/path.ipa --embed your/mobileprovision/file/path
 

IOS 命令行编译的更多相关文章

  1. iOS系统提供开发环境下命令行编译工具:xcodebuild

    iOS系统提供开发环境下命令行编译工具:xcodebuild[3] xcodebuild 在介绍xcodebuild之前,需要先弄清楚一些在XCode环境下的一些概念[4]: Workspace:简单 ...

  2. xcode命令行编译时:codesign命令,抛出“User interaction is not allowed.”异常 的处理

    之前正常运行的hudson iOS编译服务器slave节点,忽然出现编译失败.发现原因有2个: 第一个原因是编译机上用来签名的用户帐号过期,第二个原因是操作系统和xCode升级造成的. 对于第一个,重 ...

  3. 基于命令行编译打包phonegap for android应用 分类: Android Phonegap 2015-05-10 10:33 73人阅读 评论(0) 收藏

    也许你习惯了使用Eclipse编译和打包Android应用.不过,对于使用html5+js开发的phonegap应用,本文建议你抛弃Eclipse,改为使用命令行模式,绝对的快速和方便. 一直以来,E ...

  4. 用命令行编译java并生成可执行的jar包

    用命令行编译java并生成可执行的jar包 1.编写源代码. 编写源文件:CardLayoutDemo.java并保存,例如:I:\myApp\CardLayoutDemo.java.程序结构如下: ...

  5. namke 命令行编译

    简介 大家已经习惯于微软提供的功能强大的IDE,已经很少考虑手动编连项目了,所谓技多不压身,有空的时候还是随我一块了解一下命令行编译. C/C++/VC++程序员或有Unix/Linux编程经验应该很 ...

  6. 命令行编译运行Java

    首先要安装JDK,然后设置环境变量Path,添加C:\Program Files (x86)\Java\jdk1.8.0_66\bin 然后建立一个名为j.java的文件,里面加入如下代码: publ ...

  7. VS2010命令行编译C#和VC项目

    VS2010命令行编译C#和VC项目 VS2010命令行编译C#和VC项目 根据需要动态创建数据库字段后,需要动态创建或者调整页面,那就需要编译这些页面和后台文件.因此使用命令行编译将会非常方便,对于 ...

  8. Android 命令行编译、打包生成apk文件

    一.搭建搭建环境 1. 安装JDK 和 Android SDK   2. 配置环境变量 D:\android-sdk-windows\tools C:\Program Files\Java\jdk1. ...

  9. 韩顺平细说Servlet视频系列意外收获之用命令行编译带有包的java类解决方案

    命令行编译带有包的java类 在命令行编译这一块,基本上都是新手入门时了解一下,然后就直奔IDE而去.这样固然没错,就怕那些--.然后今天在视频中看到了这种方法,觉得可能会用到,所以就记录下来了,以备 ...

随机推荐

  1. 使用.net的跟踪诊断来记录wcf消息

    首先在项目的config文件中定义以下结点: <system.diagnostics> <sources> <source name="System.Servi ...

  2. php利用phpexcel导出数据

    php中利用phpexcel导出数据的实现代码.对phpexcel类库不熟悉的朋友,可以阅读下<phpexcel中文帮助手册>中的内容,具体实例大家可以phpexcel快速开发指南中的相关 ...

  3. WIN2008中部署网站后样式及JS加载不了

    今天在一台刚刚装好的WIN2008上部署一个问题,一切按流程来:① 控制面板加IIS,把.NET 3.5打勾② 装.NET 4.0框架③ 装MSSQL2012④ IIS中部署网站⑤ 修改web.con ...

  4. Apache2.2配置小结.

    lamp 1.编译安装 2,日志轮循 3,优化 4,排错 4,1 vhost :NameServer 4,2 403:虚拟主机,给目录在主配置文件里添加配置 4.3 首页文件 初始化安装完成后,如果不 ...

  5. 基于Nginx实现10万+并发,你应该做的Linux内核优化

    由于默认的linux内核参数考虑的是最通用场景,这明显不符合用于支持高并发访问的Web服务器的定义,所以需要修改Linux内核参数,是的Nginx可以拥有更高的性能: 在优化内核时,可以做的事情很多, ...

  6. 阅读ANSI C,寻找乐趣和裨益——const char **与char **为何不兼容

    #include<stdio.h> void foo1(const char**p) { } void foo2(const char*p) { } int main(int argc,c ...

  7. C陷阱与缺陷的学习笔记

    1用单引号括起的字符实际代表一个整数,整数值对应于该字符在编译器中采用的字符集对应的序列值:双引号括起的字符串,代表的是一个指向无名数组起始字符的指针,该数组被双引号之间的字符和‘\0’初始化.对于' ...

  8. IIS安全加固

    1 删除IIS默认站点 把IIS默认安装的站点删除或禁用掉. 2 禁用不必要的Web服务扩展 打开IIS 管理器,检查是否有不必要的“Web服务扩展”,如果有则禁用掉.如下图所示: 3 IIS访问权限 ...

  9. C#基础-获得当前程序的 空间名.类名.方法名

    string typeName = this.GetType().ToString();//空间名.类名 string typeName = this.GetType().Name;//类名 new ...

  10. Error reading field 'throttle_time_ms': java.nio.BufferUnderflowException

    可能出现的问题: ERROR o.a.k.c.p.i.Sender – Uncaught error in kafka producer I/O thread: org.apache.kafka.co ...