https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html

 

This manual page is part of Xcode Tools version 5.0

To obtain these tools:

If you are running a version of Xcode Tools other than 5.0, view the documentation locally:

  • In Xcode

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • To learn how the manual is organized or to learn about command syntax, read the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Developer Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.




XCODEBUILD(1)             BSD General Commands Manual            XCODEBUILD(1)

NAME
xcodebuild -- build Xcode projects and workspaces SYNOPSIS
xcodebuild [-project projectname] [-target targetname ...] [-configuration configurationname]
[-sdk [sdkfullpath | sdkname]] [buildaction ...] [setting=value ...]
[-userdefault=value ...]
xcodebuild [-project projectname] -scheme schemename [-destination destinationspecifier]
[-destination-timeout value] [-configuration configurationname]
[-sdk [sdkfullpath | sdkname]] [buildaction ...] [setting=value ...]
[-userdefault=value ...]
xcodebuild -workspace workspacename -scheme schemename [-destination destinationspecifier]
[-destination-timeout value] [-configuration configurationname]
[-sdk [sdkfullpath | sdkname]] [buildaction ...] [setting=value ...]
[-userdefault=value ...]
xcodebuild -version [-sdk [sdkfullpath | sdkname]] [infoitem]
xcodebuild -showsdks
xcodebuild -list [-project projectname | -workspace workspacename]
xcodebuild -exportArchive -exportFormat format -archivePath xcarchivepath -exportPath destinationpath
[-exportProvisioningProfile profilename] [-exportSigningIdentity identityname]
[-exportInstallerIdentity identityname] DESCRIPTION
xcodebuild builds one or more targets contained in an Xcode project, or builds a scheme contained in an
Xcode workspace or Xcode project. Usage
To build an Xcode project, run xcodebuild from the directory containing your project (i.e. the
directory containing the projectname.xcodeproj package). If you have multiple projects in the this
directory you will need to use -project to indicate which project should be built. By default,
xcodebuild builds the first target listed in the project, with the default build configuration. The
order of the targets is a property of the project and is the same for all users of the project. To build an Xcode workspace, you must pass both the -workspace and -scheme options to define the build.
The parameters of the scheme will control which targets are built and how they are built, although you
may pass other options to xcodebuild to override some parameters of the scheme. There are also several parameters to display info about the installed version of Xcode or about
projects or workspaces in the local directory, but which do not initiate a build. These include
-version, -showsdks, and -usage. Options
-project projectname
Build the project specified by projectname. Required if there are multiple project files in the
same directory. -target targetname
Build the target specified by targetname. -alltargets
Build all the targets in the specified project. -workspace workspacename
Build the workspace specified by workspacename. -scheme schemename
Build the scheme specified by schemename. Required if building a workspace. -destination destinationspecifier
Use the destination device described by destinationspecifier. Defaults to a destination that is
compatible with the selected scheme. See the section on destinations for more details. -destination-timeout timeout
Use the specified timeout when searching for a destination device. The default is 30 seconds. -configuration configurationname
Use the build configuration specified by configurationname when building each target. -arch architecture
Use the architecture specified by architecture when building each target. -sdk [<sdkfullpath> | <sdkname>]
Build an Xcode project or workspace against the specified SDK, using build tools appropriate for
that SDK. The argument may be an absolute path to an SDK, or the canonical name of an SDK. -showsdks
Lists all available SDKs that Xcode knows about, including their canonical names suitable for use
with -sdk. Does not initiate a build. -list
Lists the targets and configurations in a project, or the schemes in a workspace. Does not initi-ate initiate
ate a build. -derivedDataPath path
Overrides the folder that should be used for derived data when performing a build action on a
scheme in a workspace. -resultBundlePath path
Writes a bundle to the specified path with results from performing a build action on a scheme in
a workspace. -exportArchive
Specifies that an archive should be exported. Requires -exportFormat, -archivePath, and
-exportPath. Cannot be passed along with a build action. -exportFormat format
Specifies the format to which the archive should be exported. Valid formats are IPA (iOS archives
only), PKG (Mac archives only), and APP. If not specified, xcodebuild will attempt to auto-detect autodetect
detect the format as either IPA or PKG. -archivePath xcarchivepath
Specifies the path for the archive produced by the archive action, or specifies the archive that
should be exported when -exportArchive is passed. -exportPath destinationpath
Specifies the destination for the exported product, including the name of the exported file. -exportProvisioningProfile profilename
Specifies the provisioning profile that should be used when exporting the archive. -exportSigningIdentity identityname
Specifies the application signing identity that should be used when exporting the archive. If
possible, this may be inferred from -exportProvisioningProfile. -exportInstallerIdentity identityname
Specifies the installer signing identity that should be used when exporting the archive. If pos-sible, possible,
sible, this may be inferred from -exportSigningIdentity or -exportProvisioningProfile. -exportWithOriginalSigningIdentity
Specifies that the signing identity used to create the archive should be used when exporting the
archive. buildaction ...
Specify a build action (or actions) to perform on the target. Available build actions are: build Build the target in the build root (SYMROOT). This is the default build action. analyze Build and analyze a target or scheme from the build root (SYMROOT). This requires
specifying a scheme. archive Archive a scheme from the build root (SYMROOT). This requires specifying a scheme. test Test a scheme from the build root (SYMROOT). This requires specifying a scheme and
optionally a destination. installsrc Copy the source of the project to the source root (SRCROOT). install Build the target and install it into the target's installation directory in the dis-tribution distribution
tribution root (DSTROOT). clean Remove build products and intermediate files from the build root (SYMROOT). -xcconfig filename
Load the build settings defined in filename when building all targets. These settings will over-ride override
ride all other settings, including settings passed individually on the command line. -dry-run, -n
Print the commands that would be executed, but do not execute them. -skipUnavailableActions
Skip build actions that cannot be performed instead of failing. This option is only honored if
-scheme is passed. setting=value
Set the build setting setting to value. -userdefault=value
Set the user default default to value. -version
Display version information for this install of Xcode. Does not initiate a build. When used in
conjunction with -sdk, the version of the specified SDK is displayed, or all SDKs if -sdk is
given no argument. Additionally, a single line of the reported version information may be
returned if infoitem is specified. -usage
Displays usage information for xcodebuild. Destinations
The -destination option takes as its argument a destination specifier describing the device (or
devices) to use as a destination. A destination specifier is a single argument consisting of a set of
comma-separated key=value pairs. The -destination option may be specified multiple times to cause
xcodebuild to perform the specified action on multiple destinations. Destination specifiers may include the platform key to specify one of the supported destination plat-forms. platforms.
forms. There are additional keys which should be supplied depending on the platform of the device you
are selecting. Some devices may take time to look up. The -destination-timeout option can be used to specify the
amount of time to wait before a device is considered unavailable. If unspecified, the default timeout
is 30 seconds. Currently, xcodebuild supports these platforms: OS X The local Mac, referred to in the Xcode interface as My Mac, and which supports the fol-lowing following
lowing keys: arch The architecture to use, either x86_64 (the default) or i386. iOS An iOS device, which supports the following keys: name The name of the device to use. id The identifier of the device to use, as shown in the Devices tab of the Xcode
Organizer. iOS Simulator The iOS Simulator, which supports the following keys: name The full name of device to simulate, as presented in Xcode's UI. OS The version of iOS to simulate, such as 6._, or the string latest (the default) to
indicate the most recent version of iOS supported by this version of Xcode. Some actions (such as building) may be performed without an actual device present. To build against a
platform generically instead of a specific device, the destination specifier may be prefixed with the
optional string "generic/", indicating that the platform should be targeted generically. An example of
a generic destination is the "iOS Device" destination displayed in Xcode's UI when no physical iOS
device is present. Exporting Archives
The -exportArchive option specifies that xcodebuild should export the archive specified by -archivePath
to the format specified by -exportFormat. The exported product will be placed at the path specified by
-exportPath. Re-signing when exporting an archive is optional. The provisioning profile that should be
embedded in the exported product can be specified by -exportProvisioningProfile. In some cases, the
application signing identity that should be used during the export can be determined from the provision-ing provisioning
ing profile. For cases where that is not possible (including when no provisioning profile is embedded in
the exported product), an application signing identity can be specified with -exportSigningIdentity.
When exporting a Mac archive as PKG, an installer signing identity can be used to sign the exported pack-age. package.
age. This may be inferred from the application signing identity (for instance, if "Developer ID Applica-tion" Application"
tion" is specified for the application signing identity, "Developer ID Installer" will automatically be
inferred), but it can be explicitly specified using -exportInstallerIdentity. Environment Variables
The following environment variables affect the execution of xcodebuild: XCODE_XCCONFIG_FILE
Set to a path to a file, build settings in that file will be loaded and used when build-ing building
ing all targets. These settings will override all other settings, including settings
passed individually on the command line, and those in the file passed with the -xcconfig
option. Exit Codes
xcodebuild exits with codes defined by sysexits(3). It will exit with EX_OK on success. On failure, it
will commonly exit with EX_USAGE if any options appear malformed, EX_NOINPUT if any input files cannot be
found, EX_IOERR if any files cannot be read or written, and EX_SOFTWARE if the commands given to xcode-build xcodebuild
build fail. It may exit with other codes in less common scenarios. EXAMPLES
xcodebuild clean install Cleans the build directory; then builds and installs the first target in the Xcode project in
the directory from which xcodebuild was started. xcodebuild -target MyTarget OBJROOT=/Build/MyProj/Obj.root SYMROOT=/Build/MyProj/Sym.root Builds the target MyTarget in the Xcode project in the directory from which xcodebuild was
started, putting intermediate files in the directory /Build/MyProj/Obj.root and the products
of the build in the directory /Build/MyProj/Sym.root. xcodebuild -sdk macosx10.6 Builds the Xcode project in the directory from which xcodebuild was started against the Mac OS
X 10.6 SDK. The canonical names of all available SDKs can be viewed using the -showsdks
option. xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme Builds the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace. xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme archive Archives the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace. xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination 'platform=OS X,arch=x86_64'
test Tests the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace using the destination
described as My Mac 64-bit in Xcode. xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination 'platform=iOS
Simulator,name=iPhone' -destination 'platform=iOS,name=My iPad' test Tests the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace using both the iOS
Simulator configured as an iPhone and the the iOS device named My iPad. (Note that the shell
requires arguments to be quoted or otherwise escaped if they contain spaces.) xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination generic/platform=iOS build Builds the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace using the generic
iOS Device destination. xcodebuild -exportArchive -exportFormat IPA -archivePath MyMobileApp.xcarchive -exportPath
MyMobileApp.ipa -exportProvisioningProfile 'MyMobileApp Distribution Profile' Exports the archive MyMobileApp.xcarchive as an IPA file to the path MyMobileApp.ipa using the
provisioning profile MyMobileApp Distribution Profile. xcodebuild -exportArchive -exportFormat APP -archivePath MyMacApp.xcarchive -exportPath MyMacApp.pkg
-exportSigningIdentity 'Developer ID Application: My Team' Exports the archive MyMacApp.xcarchive as a PKG file to the path MyMacApp.pkg using the appli-cation application
cation signing identity Developer ID Application: My Team. The installer signing identity
Developer ID Installer: My Team is implicitly used to sign the exported package.

This manual page is part of Xcode Tools version 5.0的更多相关文章

  1. 关于The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum...

    今天将项目迁移到另一台笔记本,进行build出现以下问题,导致build失败 The specified Android SDK Build Tools version (26.0.2) is ign ...

  2. Wndows 下npm 安装依赖时出现错误:MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".

    当在Windows环境中使用npm install或者yarn 安装依赖时,可能会出现如下类似的错误: MSBUILD : error MSB4132: The tools version " ...

  3. 安卓 android studio 报错 The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle

    今天将项目迁移到另一台笔记本,进行build出现以下问题,导致build失败 报错截图: 大致意思,目前使用的build工具版本27.0.3不合适.因为当前使用Gradle插件版本是3.2.1,这个版 ...

  4. git-push(1) Manual Page

    git-push(1) Manual Page NAME git-push - Update remote refs along with associated objects SYNOPSIS gi ...

  5. 【socket编程】select manual page翻译

    原文: select manual page 依赖的头文件 /* According to POSIX.1-2001, POSIX.1-2008 */ #include <sys/select. ...

  6. 时区提示:Local time zone must be set--see zic manual page 2018的解决办法

    问题描述:在centos服务器上执行date命令时,显示的时间信息中的时区不正常,如下: [root@ulocalhost ~]# date Mon Apr 9 02:57:38 Local time ...

  7. #include <sys/epoll.h> epoll - I/O event notification facility 服务器端 epoll(7) - Linux manual page http://www.man7.org/linux/man-pages/man7/epoll.7.html

    epoll使用详解(精髓) - Boblim - 博客园 https://www.cnblogs.com/fnlingnzb-learner/p/5835573.html epoll使用详解(精髓) ...

  8. 解决无法修改日志时间的问题(Local time zone must be set--see zic manual page 2019 )

    故障现象 系统日志时间晚了整整8个小时,比如现在是中午12点,日志时间为凌晨4点 date命令报错(Local time zone must be set--see zic manual page) ...

  9. check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc

    往一个新建的MySQL表中插入数据报错 2018-08-22 14:09:18.875 ERROR 9256 --- [apr-8080-exec-9] o.s.b.w.servlet.support ...

随机推荐

  1. Regex.Escape

    C# 字符串变量str 的值为"a\nb"如果直接输出显示的话,就成了:ab需要输出显示为:a\nb问,怎么办?千万别告诉我定义: str=@"a\nb",因为 ...

  2. PHP 函数的引用传递

    $a = "nowamagic";$b =& $a;echo $b.$a; 这意味着 $a 和 $b 指向了同一个变量.同一个变量内容有不同的变量名,引用就是这么个回事. ...

  3. JNDI--Java命名和目录接口

    JNDI主要用于在容器中配置某些资源,让所有项目可以使用.JNDI可以提供: 1:数据库连接池.            自定义连接池             第三方连接池 Dbcp           ...

  4. 关于asp.net会话阻塞

    现象:在一个网站中,当访问一个处理比较耗时的页面(A页面),页面请求还没有返回时,此时再点击访问该网站的其他页面(B页面)会出现B页面很久都没有响应和返回,直到A页面输出返回数据时才开始处理B页面的请 ...

  5. Android应用----如何让应用全屏

    一般Android的应用启动时都有欢迎界面,类似QQHD启动那样.比较大方绚丽.心动不如行动,有时间自己也来实现类似的效果,嘿嘿.    观察发现QQHD的欢迎界面是全屏的,这个好办.下面就Andro ...

  6. d008: 求两数的整数商 和 商

    内容: 求两数的整数商 和 商 ,商保留两位小数 输入说明: 一行 两个整数 输出说明: 一行,一个整数,一个实数(两位小数) 输入样例:   12 8 输出样例 : 1 1.50 #include ...

  7. Applet: 用HTML调用Applet的几个注意事项

    问题:HTML找不到java class. 首先,如果xxx.java文件与HTML文件在同一目录下,直接运行cmd-javac 该 xxx.java文件,生成xxx.class文件.HTML中的&l ...

  8. iOS UITableView的使用大全-备用

    首先.对UITableView进行讲解,下面有对它进行实际的应用 UITableView 显示大型内容的列表 单行,多列 垂直滚动,没有水平滚动 大量的数据集 性能强大,而且普遍存在于iPhone的应 ...

  9. 从汇编来看c语言之变量

    1.基础研究 对如图程序进行编译连接,再用debug加载. 我们在偏移地址1fa处查看main函数的内容: 执行到1fd处,发现n的偏移地址为01a6,段地址存储在ds寄存器里,为07c4. 再查看函 ...

  10. Ubuntu下Git服务端搭建

    1安装git $ sudo add-apt-repository ppa:git-core/ppa $ sudo apt-get update $ sudo apt-get install git 测 ...