#!/bin/sh # Builds the Mac (Catalyst) app and replaces the copy in /Applications. # # Xcode 27 keeps its tools out of the default PATH unless xcode-select points at it, which on # this machine it does not, so DEVELOPER_DIR is set here rather than relied upon. set -eu DEVELOPER_DIR=${DEVELOPER_DIR:-/Applications/Xcode.app/Contents/Developer} export DEVELOPER_DIR cd "$(dirname "$0")/../ios" command -v xcodegen > /dev/null || { echo "xcodegen missing: brew install xcodegen" >&2; exit 1; } xcodegen generate > /dev/null DERIVED=${DERIVED:-/tmp/ipx-mac} xcodebuild -project iPodderX.xcodeproj -scheme iPodderX \ -destination 'platform=macOS,variant=Mac Catalyst' \ -derivedDataPath "$DERIVED" -configuration Release \ CODE_SIGNING_ALLOWED=NO build > /dev/null APP="$DERIVED/Build/Products/Release-maccatalyst/iPodderX.app" [ -d "$APP" ] || { echo "no app at $APP" >&2; exit 1; } # Quit the running copy first, or the replacement is the one still in memory. osascript -e 'tell application "iPodderX" to quit' 2>/dev/null || true sleep 2 rm -rf /Applications/iPodderX.app cp -R "$APP" /Applications/iPodderX.app # Ad-hoc, because the build is unsigned. Build in Xcode with your own team for one you keep. codesign --force --sign - /Applications/iPodderX.app /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \ -f /Applications/iPodderX.app 2>/dev/null || true echo "installed /Applications/iPodderX.app"