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 Configurations:
Debug
Release
If no 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 ** clean succeeded **
5. xcodebuild compilation Parameters
IPhone-command line compilation-xcodebuild