#!/bin/sh # Builds Orgstar.app for the iOS Simulator in .build/ios-app from the OrgstarMobile product, # signed ad hoc. Install with `xcrun simctl install booted .build/ios-app/Orgstar.app`. # Usage: scripts/build-ios-app.sh [version] set -eu cd "$(dirname "$0")/.." version="${1:-0.1.0}" app=".build/ios-app/Orgstar.app" products=".build/ios/Build/Products/Debug-iphonesimulator" xcodebuild -scheme OrgstarMobile -destination 'generic/platform=iOS Simulator' -derivedDataPath .build/ios build -quiet rm -rf "$app" mkdir -p "$app" cp "$products/OrgstarMobile" "$app/OrgstarMobile" for bundle in "$products"/*.bundle; do [ -e "$bundle" ] && cp -R "$bundle" "$app/" done cat > "$app/Info.plist" < CFBundleIdentifier sh.krz.orgstar CFBundleName Orgstar CFBundleDisplayName Orgstar CFBundleExecutable OrgstarMobile CFBundlePackageType APPL CFBundleShortVersionString ${version} CFBundleVersion ${version} CFBundleSupportedPlatforms iPhoneSimulator MinimumOSVersion 26.0 UIDeviceFamily 12 UILaunchScreen UIApplicationSceneManifest UIApplicationSupportsMultipleScenes UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight CFBundleURLTypes CFBundleURLName org-protocol CFBundleURLSchemes org-protocol PLIST codesign --force --sign - "$app" echo "$app"