xcodebuild 是苹果提供的打包项目或者工程的命令,了解该命令最好的方式就是使用 man xcodebuild 查看其 man page. 尽管是英文,一定要老老实实的读一遍就好了。
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 name.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 options that display info about the installed version of Xcode or about projects or workspaces in the local directory, but which do not initiate an action. These include -list, -showBuildSettings, -showsdks, -usage, and -version.
Information about project "NavTabBar":
Targets:
NavTabBar
NavTabBarTests
NavTabBarUITests
Build Configurations:
Debug
Release
Ad-hoc
If no build configuration is specified and -scheme is not passed then "Release" is used.
Schemes:
NavTabBar
[-s signature]: certificate name to resign application before packaging [-o output_directory]: specify output filename [-plugin plugin]: specify an optional plugin -help: brief help message -man: full documentation -v[erbose]: provide details during operation
Options: -h, --help: show this help message and exit -w name.xcworkspace, --workspace=name.xcworkspace: Build the workspace name.xcworkspace. -p name.xcodeproj, --project=name.xcodeproj: Build the project name.xcodeproj. -s schemename, --scheme=schemename: Build the scheme specified by schemename. Required if building a workspace. -t targetname, --target=targetname: Build the target specified by targetname. Required if building a project. -o output_filename, --output=output_filename: specify output filename
其中,CODE_SIGN_IDENTITY 为开发者证书标识,可以在 Keychain Access -> Certificates -> 选中证书右键弹出菜单 -> Get Info -> Common Name 获取,类似 iPhone Distribution: Company name Co. Ltd (xxxxxxxx9A), 包括括号内的内容。