iphoneos5.0下的编译脚本:
xcodebuild -project "xxx.xcodeproj" -configuration "Debug" -target "xxx" -sdk "iphoneos5.0" -arch "armv6 armv7" build RUN_CLANG_STATIC_ANALYZER=NO $(BUILD_DIR)="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
iphonesimulator5.0下的编译脚本:
xcodebuild -project "xxx.xcodeproj" -configuration "Debug" -target "xxx" -sdk "iphonesimulator5.0" -arch "i386" build RUN_CLANG_STATIC_ANALYZER=NO $(BUILD_DIR)="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
加上下面一句表示输出到文件:
> "${BUILD_ROOT}.build_output"
lipo脚本工具:合并iPhone模拟器和真机的静态类库,生成通用库
lipo -create -output "${CREATING_UNIVERSAL_DIR}/${EXECUTABLE_NAME}" "${CURRENTCONFIG_DEVICE_DIR}/${EXECUTABLE_NAME}" "${CURRENTCONFIG_SIMULATOR_DIR}/${EXECUTABLE_NAME}"
意思是:把"${CURRENTCONFIG_DEVICE_DIR}目录下的.a文件,和${CURRENTCONFIG_SIMULATOR_DIR}目录下的.a文件合并,
在${CREATING_UNIVERSAL_DIR}目录下,生成两个设备都通用的静态库,
例如:lipo -create -output xy.a x.a y.a