# Settings: # Path to store the x-platform lib and header files: MY_LIBS_PATH="$DEVELOPER_DIR/myLibs/" # Name of the library target: MY_TARGET="myAwesome" # Build for Simulator and Device: xcodebuild -target $MY_TARGET -sdk iphonesimulator3.0 -activeconfiguration xcodebuild -target $MY_TARGET -sdk iphoneos3.0 -activeconfiguration # Make new folder if it doesn't exist: mkdir -p "$MY_LIBS_PATH/lib$PRODUCT_NAME-$CONFIGURATION" # Concat the libraries with lipo: $PLATFORM_DEVELOPER_BIN_DIR/lipo -arch arm "$BUILD_DIR/$CONFIGURATION-iphoneos/lib$PRODUCT_NAME.a" -arch i386 "$BUILD_DIR/$CONFIGURATION-iphonesimulator/lib$PRODUCT_NAME.a" -create -output "$MY_LIBS_PATH/lib$PRODUCT_NAME-$CONFIGURATION/lib$PRODUCT_NAME.a" # Copy public headers: cd "$BUILD_DIR/$CONFIGURATION-iphoneos/$PUBLIC_HEADERS_FOLDER_PATH" cp *.h "$MY_LIBS_PATH/lib$PRODUCT_NAME-$CONFIGURATION/" # Clean up temp dirs: # rm -r "$BUILD_DIR" # Show in library finder: open "$MY_LIBS_PATH/lib$PRODUCT_NAME-$CONFIGURATION/" exit 0