转自:简书

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:

$ 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

$ agvtool new-marketing-version 1.2
$ agvtool new-version -all 1.2

Step3: Unlock keychian

You can use follow command do this step

security list-keychains -s ~/Library/Keychains/login.keychain
security default-keychain -d user -s ~/Library/Keychains/login.keychain
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

$ xcodebuild -h

Usage: xcodebuild [-project <projectname>] [[-target <targetname>]...|-alltargets] [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild [-project <projectname>] -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild -workspace <workspacename> -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]... [-sdk [<sdkname>|<sdkpath>]] [-showBuildSettings] [<buildsetting>=<value>]... [<buildaction>]...
xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
xcodebuild -showsdks Options:
-usage print brief usage
-help print complete usage
-verbose provide additional status output
-license Show License agreement!
-project NAME build the project NAME
-target NAME build the target NAME
-alltargets build all targets
-workspace NAME build the workspace NAME
-scheme NAME build the scheme NAME
-configuration NAME use the build configuration NAME for building each target
-xcconfig PATH apply the build settings defined in the file at PATH as overrides
-arch ARCH build each target for the architecture ARCH; this will override architectures defined in the project
-sdk SDK use SDK as the name or path of the base SDK when building the project
-toolchain NAME use the toolchain with identifier or name NAME
-parallelizeTargets build independent targets in parallel
-jobs NUMBER specify the maximum number of concurrent build operations
-dry-run do everything except actually running the commands
-showsdks display a compact list of the installed SDKs
-showBuildSettings display a list of build settings and values
-list lists the targets and configurations in a project, or the schemes in a workspace
-find-executable NAME display the full path to executable NAME in the provided SDK and toolchain
-find-library NAME display the full path to library NAME in the provided SDK and toolchain
-version display the version of Xcode; with -sdk will display info about one or all installed SDKs

Show current xcodebuild version

$ xcodebuild -version
Xcode 4.5.2
Build version 4G2008a

Show current SDK

$ xcodebuild -showsdks
OS X SDKs:
Mac OS X 10.7 -sdk macosx10.7
OS X 10.8 -sdk macosx10.8
iOS SDKs:
iOS 6.0 -sdk iphoneos6.0
iOS Simulator SDKs:
Simulator - iOS 6.0 -sdk iphonesimulator6.0

Show project information in project folder

$ xcodebuild -list

Build project via iOS 6.0 sdks

$ xcodebuild -sdk iphoneos6.0

or command

$ 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:

$ 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. CoCos2D-X-2.1.5在Eclipse中导入HelloCpp项目搭建

    1.前言 最新正在做一个校园增强现实的应用,虽然不知道cocos2d-x具体到最后能做成什么样子,但还是拿来试试,本文章仅从在Eclipse中采用复制一个新项目副本的方式来导入一个现成的HelloCp ...

  2. python切片 []取值操作符

    切片1.什么叫切片数组,元组等含有多个元素的集合,取其中的一段元素的操作,叫做切片 2.取前10个元素 l = list(range(100)) l3 = l[:10] print(l3) 运行结果: ...

  3. ny710 外星人的供给站

    外星人的供给站 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描述 外星人指的是地球以外的智慧生命.外星人长的是不是与地球上的人一样并不重要,但起码应该符合我们目前对生命基本 ...

  4. 使用tesseract-ocr破解网站验证码

    首先我得承认,关注tesseract-ocr, 是冲着下面这篇文章的噱头去的,26行groovy代码破解网站验证码 http://www.kellyrob99.com/blog/2010/03/14/ ...

  5. ADO.NET 连接方式进行数据库访问

    转自:http://www.cnblogs.com/oneword/archive/2010/09/10/1823414.html 连接到数据源 连接到数据源需要使用两步: 1.创建连接字符串 2.使 ...

  6. 重装Ubuntu系统

    1.安装JDK参考:http://weixiaolu.iteye.com/blog/1401786jdk-6u31-linux-i586.bin莫名奇妙的安装失败.所以下载了jdk-7u45-linu ...

  7. tomcat 启动 报错Neither the JAVA_HOME nor the JRE_HOME environment variable is definedtemp

    catalina.sh 加入环境 export JAVA_HOME=/usr/local/jdk1.7.0_79 export CATALINA_HOME=/home/sa/webserver/tom ...

  8. 1U是什么意思

    U(unit的缩写)是服务器尺寸的单位规定的尺寸是服务器的宽度和高度,48.26cm=19英寸,高度4.445cm的倍数. 所谓“1U的PC服务器”,就是外形满足EIA规格.厚度为4.445cm的产品 ...

  9. iOS使用webView加载HTML网页链接简单展示

    //网页视图 _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 64, mWidth, mHeight-64)]; _webView.d ...

  10. 个推-推送hello world

    最近项目中的一个百度推送真是把我搞的有点头大,真的是很垃圾,到达率又低,还特么遇上停止维护了... 所以项目决定转用别的推送平台,现在改用个推,官方文档写的很好,除了刚下载下来,折腾了一阵子,不过很快 ...