A line from Xcode from the command line looks like this:
xcodebuild -configuration ${BUILD_TYPE} -target ${TARGET_NAME} -arch ${CPU_ARCHITECTURE} -sdk ${SIMULATOR_OR_IOS_SDK}
BUILD_TYPE
is something like "Release" or "Debug" (these are the default values, maybe you added others to the project)
TARGET_NAME
- the name of the goal you are building (defaults to the name of your project)
CPU_ARCHITECTURE
is the processor for which you are building, one of:
i386 , armv6 , armv7
Use i386 to build a simulator and use armv6 or armv7 to build devices - note that some other devices cannot run armv7 code, so it is usually recommended to create all these architectures when creating libraries and then gluing them together using lipo
.
SIMULATOR_OR_IOS_SDK
is what you are looking for, it is either iphoneos
or iphonesimulator
. These values ββuse the latest version of the SDK that the installed Xcode supports, you can get a list of supported SDKs with:
xcodebuild -showsdks
Which returns a list, for example:
Mac OS X SDKs: Current Mac OS -sdk Mac OS X 10.6 -sdk macosx10.6 iOS SDKs: iOS 4.2 -sdk iphoneos4.2 iOS Simulator SDKs: Simulator - iOS 3.2 -sdk iphonesimulator3.2 Simulator - iOS 4.0 -sdk iphonesimulator4.0 Simulator - iOS 4.1 -sdk iphonesimulator4.1 Simulator - iOS 4.2 -sdk iphonesimulator4.2
xcodebuild
contains more flags, but the ones you usually use after using Xcode to set build properties. You donβt have to use all of them, but it would probably be nice to understand what you are building - otherwise I think your latest settings are being used.
Kendall Helmstetter Gelner Feb 15 '11 at 23:18 2011-02-15 23:18
source share