#!/bin/bash # run.sh builds EPOD Window Bar, kills the running instance, copies the app # to ~/Applications, and starts it. Always run the app from ~/Applications. # A stable path and a stable signature keep the macOS permissions. set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" APP_DISPLAY_NAME="EPOD Window Bar" PRODUCT_NAME="EPODWindowBar" SCHEME="EPODWindowBar" CONFIG="Debug" DERIVED="$ROOT/.build/derived" BUILT_APP="$DERIVED/Build/Products/$CONFIG/$PRODUCT_NAME.app" DEST_APP="$HOME/Applications/$APP_DISPLAY_NAME.app" echo "==> Generate the Xcode project with XcodeGen" xcodegen generate echo "==> Build with xcodebuild" # The signing comes from Config.xcconfig. The default is ad-hoc signing. # Copy Local.xcconfig.example to Local.xcconfig to sign with your team ID. xcodebuild \ -project "EPODWindowBar.xcodeproj" \ -scheme "$SCHEME" \ -configuration "$CONFIG" \ -derivedDataPath "$DERIVED" \ build echo "==> Kill the running instance" killall "$PRODUCT_NAME" 2>/dev/null || true echo "==> Copy the app to ~/Applications" mkdir -p "$HOME/Applications" rm -rf "$DEST_APP" cp -R "$BUILT_APP" "$DEST_APP" echo "==> Start the app" open "$DEST_APP" echo "==> Done. App is at: $DEST_APP"