Build Process
This document describes the build process for creating distributable LinkSDK XCFrameworks, covering local development builds, the automated build script, and integration with the CI/CD pipeline. The build process transforms the LinkSDK source code into a universal XCFramework that supports both iOS devices and simulators.
For information about the CI/CD pipeline and automated releases, see CI/CD Pipeline. For local development and testing setup, see Testing.
Build Script Overview
The LinkSDK uses a shell script-based build system that creates universal XCFrameworks suitable for distribution. The primary build script is build-framework.sh(), which handles the complete build, packaging, and distribution preparation process.
Build Script Execution Flow
Build Script Start
Set MARKETING_VERSION and CURRENT_PROJECT_VERSION
xcodebuild archive
iOS Device Platform
xcodebuild archive
iOS Simulator Platform
xcodebuild -create-xcframework
Combine iOS + Simulator
Update Info.plist
CFBundleVersion
Copy XCFramework to Root
Create .zip Archive
Compute Swift Package Checksum
Update Package.swift
Remove Build Artifacts
Sources: build-framework.sh1-64
XCFramework Creation Process
Platform-Specific Builds
The build process creates separate archives for each supported platform using xcodebuild archive commands. The LinkSDK framework is built twice with different destination platforms:
| Platform | Destination | Archive Path |
|---|---|---|
| iOS Device | generic/platform=iOS |
LinkSDK.framework-iphoneos.xcarchive |
| iOS Simulator | generic/platform=iOS Simulator |
LinkSDK.framework-iphonesimulator.xcarchive |
Build Configuration Parameters
The build script configures several critical parameters for each platform build:
IPHONEOS_DEPLOYMENT_TARGET=13.0
SKIP_INSTALL=NO
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
MARKETING_VERSION=$MARKETING_VERSION
CURRENT_PROJECT_VERSION=$CURRENT_PROJECT_VERSION
Sources: build-framework.sh19-41
XCFramework Assembly
After creating platform-specific archives, the script combines them into a single XCFramework using the xcodebuild -create-xcframework command. This process merges the iOS device and simulator frameworks into a universal binary that automatically selects the appropriate architecture at build time.
Output
XCFramework Creation
Input Archives
LinkSDK.framework-iphoneos.xcarchive
iOS Device Framework
LinkSDK.framework-iphonesimulator.xcarchive
iOS Simulator Framework
xcodebuild -create-xcframework
LinkSDK.xcframework
Universal Binary
Sources: build-framework.sh43-47
Version Management
Version Parameter Handling
The build script accepts a version parameter and derives related version identifiers:
MARKETING_VERSION: Full semantic version (e.g., "1.2.3")CURRENT_PROJECT_VERSION: Major version number extracted from marketing version
If no version is provided, the script defaults to version "1.0".
Info.plist Version Updates
The script updates the XCFramework's Info.plist file with version information using the PlistBuddy utility:
/usr/libexec/Plistbuddy -c "Add :CFBundleVersion string $MARKETING_VERSION" "$PLIST"
/usr/libexec/Plistbuddy -c "Add :CFBundleShortVersionString string $CURRENT_PROJECT_VERSION" "$PLIST"
Sources: build-framework.sh49-50
Xcode Project Configuration
Target Structure
The LinkSDK Xcode project contains three primary targets defined in the project configuration:
| Target Name | Product Type | Purpose |
|---|---|---|
LinkSDK |
com.apple.product-type.framework |
Main framework library |
LinkSDKExample |
com.apple.product-type.application |
Example implementation app |
LinkSDKTests |
com.apple.product-type.bundle.unit-test |
Unit test bundle |
Framework Build Settings
The LinkSDK framework target uses specific build settings optimized for distribution:
| Setting | Value | Purpose |
|---|---|---|
BUILD_LIBRARY_FOR_DISTRIBUTION |
YES |
Enables module stability for distribution |
MACH_O_TYPE |
staticlib |
Creates static library binary |
SKIP_INSTALL |
YES |
Prevents automatic installation |
IPHONEOS_DEPLOYMENT_TARGET |
13.0 |
Minimum iOS version support |
ENABLE_MODULE_VERIFIER |
YES |
Enables module interface verification |
SWIFT_INSTALL_OBJC_HEADER |
NO |
Disables Objective-C header generation |
DEFINES_MODULE |
NO |
Framework module definition handling |
Sources: LinkSDK.xcodeproj/project.pbxproj610-692
Code Signing Configuration
The framework target uses manual code signing with conditional team settings:
CODE_SIGN_STYLE = Manual
DEVELOPMENT_TEAM = ""
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = C6WMXUCWYF
Sources: LinkSDK.xcodeproj/project.pbxproj622-628
Swift Package Manager Integration
Package.swift Updates
The build script automatically updates the Package.swift file with the new framework URL and checksum:
CHECKSUM=`swift package compute-checksum "$SDK_FRAMEWORK_FILENAME.zip"`
SDK_URL="https://github.com/FrontFin/mesh-ios-sdk/releases/download/$MARKETING_VERSION/$SDK_FRAMEWORK_FILENAME.zip"
sed -i '' "s|checksum: ".*"|checksum: \"$CHECKSUM\"|g" Package.swift
sed -i '' "s|url: ".*"|url: \"$SDK_URL\"|g" Package.swift
This ensures that Swift Package Manager can verify the integrity of the distributed XCFramework and download it from the correct GitHub release URL.
Sources: build-framework.sh57-62
Build Outputs and Artifacts
File Structure
The build process generates the following artifacts:
./
├── LinkSDK.xcframework/ # Universal XCFramework
│ ├── Info.plist # Framework metadata
│ ├── ios-arm64/ # iOS device architecture
│ └── ios-arm64_x86_64-simulator/ # iOS simulator architectures
├── LinkSDK.xcframework.zip # Compressed distribution package
└── Package.swift # Updated with new checksum/URL
Build Folder Management
The script uses a temporary ./build folder for intermediate artifacts and cleans up after completion:
BUILD_FOLDER='./build'
# ... build operations ...
rm -r $BUILD_FOLDER
Sources: build-framework.sh13-53
Local Development Usage
Manual Build Execution
Developers can execute the build script locally with an optional version parameter:
# Build with default version (1.0)
./build-framework.sh
# Build with specific version
./build-framework.sh 2.1.0
Prerequisites
Local builds require:
- Xcode 15.0 or later (compatible with
objectVersion = 70) - Valid Apple Developer certificate for code signing
- Access to QuantumIOS dependency package
Sources: LinkSDK.xcodeproj/project.pbxproj6 build-framework.sh1-64