#!/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" for scheme in OrgstarMobile OrgstarQuickLook; do xcodebuild -scheme "$scheme" -destination 'generic/platform=iOS Simulator' -derivedDataPath .build/ios build -quiet done 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 UTImportedTypeDeclarations UTTypeIdentifier org.orgmode.org UTTypeDescription Org document UTTypeConformsTo public.text UTTypeTagSpecification public.filename-extension orgorg_archive CFBundleURLTypes CFBundleURLName org-protocol CFBundleURLSchemes org-protocol PLIST # Quick Look previews of org files, in Files and wherever else Quick Look shows them. appex="$app/PlugIns/OrgstarQuickLook.appex" mkdir -p "$appex" cp "$products/OrgstarQuickLook" "$appex/OrgstarQuickLook" cat > "$appex/Info.plist" < CFBundleIdentifier sh.krz.orgstar.quicklook CFBundleName OrgstarQuickLook CFBundleDisplayName Orgstar CFBundleExecutable OrgstarQuickLook CFBundlePackageType XPC! CFBundleShortVersionString ${version} CFBundleVersion ${version} CFBundleSupportedPlatforms iPhoneSimulator MinimumOSVersion 26.0 NSExtension NSExtensionPointIdentifier com.apple.quicklook.preview NSExtensionPrincipalClass PreviewProvider NSExtensionAttributes QLSupportedContentTypes org.orgmode.org QLIsDataBasedPreview PLIST codesign --force --sign - "$appex" codesign --force --sign - "$app" echo "$app"