Repository Public MIT
1#!/usr/bin/env bash2# ORIX Calc3# File: Scripts/shot.sh4# Description: Launches the built app in a dedicated simulator with launch options and saves a real screenshot.5# usage: shot.sh <iphone|ipad> <out.png> [launch arguments…]6#7# Author: Simon-Pierre Boucher8# Contact: contact@spboucher.ai9set -euo pipefail10cd "$(dirname "$0")/.."11device="ORIXCalc iPhone"; [[ "$1" == ipad ]] && device="ORIXCalc iPad"12out="$2"; shift 213app="build/DerivedData/Build/Products/Debug-iphonesimulator/ORIXCalc.app"14xcrun simctl boot "$device" 2>/dev/null || true15xcrun simctl bootstatus "$device" -b >/dev/null16xcrun simctl status_bar "$device" override --time "9:41" --batteryState charged --batteryLevel 100 --cellularBars 4 --wifiBars 3 2>/dev/null || true17xcrun simctl terminate "$device" ai.spboucher.orix.calc 2>/dev/null || true18xcrun simctl install "$device" "$app"19xcrun simctl launch "$device" ai.spboucher.orix.calc -ORIXInMemory 1 "$@" >/dev/null20sleep "${ORIX_SHOT_DELAY:-4}"21xcrun simctl io "$device" screenshot "$out" >/dev/null 2>&122echo "$out"23