1. Check the xcode version and build version.
$ Xcodebuild-version
Display content:
Xcode 4.2
Build version 4d199
2. display the SDK and its version of the current system
$ Xcodebuild-showsdks
Display content:
Mac OS X sdks:
Mac OS X 10.6-SDK macosx10.6
Mac OS X 10.7-SDK macosx10.7
IOS sdks:
IOS 5.0-SDK iphoneos5.0
IOS simulator sdks:
Simulator-Ios 5.0-SDK iphonesimulator5.0
3. Display project information
First CD to the project directory (there is a directory of *. xcodeproj, such as makefiletest. xcodeproj), and then enter the command
$ Xcodebuild-list
Display content
Information about Project"Makefiletest":
Targets:
Makefiletest
Build deployments:
Debug
Release
IfNo build configuration is specified and-scheme is not passed then"Release"Is used.
Schemes:
Makefiletest
If not specified, the default value is release.
4. xcodebuild usage:
1) Use ios5.0 simulator (iphonesimulator5.0) to create a project
$ Xcodebuild-SDK iphonesimulator5.0
Output a bunch of compilation processes. The final output ** build succeeded ** indicates that the creation is successful;
If ** build failed ** is output, the creation fails.
The build directory is created under the current project directory. The structure is as follows:
Makefiletest. app is the executable file generated by compilation,
While the makefiletest. Build folder contains some intermediate files.
2) The default project is the release project. The debug mode should be set as follows:
$ Xcodebuild-SDK iphonesimulator5.0-configuration debug
3) projects created by clean
$ Xcodebuild clean-SDK iphonesimulator5.0-configuration debug
Output successfully**Clean succeeded**
5. xcodebuild compilation Parameters