#!/usr/bin/env bash # Build the native iOS app. Usage: # ./build.sh simulator (default) # ./build.sh device (signed with the TZGyn team) set -euo pipefail HERE="$(cd "$(dirname "$0")" && pwd)" TARGET="${1:-simulator}" "$HERE/build-go.sh" cd "$HERE" xcodegen generate case "$TARGET" in simulator|sim) xcodebuild \ -project Share.xcodeproj \ -scheme Share \ -configuration Debug \ -sdk iphonesimulator \ -destination 'generic/platform=iOS Simulator' \ ARCHS=arm64 ONLY_ACTIVE_ARCH=NO \ -derivedDataPath /tmp/share-dd \ build ;; device) xcodebuild \ -project Share.xcodeproj \ -scheme Share \ -configuration Debug \ -sdk iphoneos \ -destination 'generic/platform=iOS' \ -allowProvisioningUpdates \ -derivedDataPath /tmp/share-dd-device \ build ;; *) echo "usage: $0 [simulator|device]" >&2 exit 2 ;; esac