Repository Public MIT
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : ORIX Astra8# File : Scripts/shot.sh9# Module : Scripts10# Repository : https://git.spboucher.ai/orix-astra11# Created : 2026-11-2112# Last Modified : 2026-11-2113#14# Author : Simon-Pierre Boucher15# Position : Professor of Finance16# Institution : Université du Québec en Outaouais (UQO)17# Organization : SP Boucher18# Website : https://spboucher.ai19# Git : https://git.spboucher.ai20#21# Preferred Contact: support@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License : Proprietary, all rights reserved (see license file)32# License File : LICENSE33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# Usage: Scripts/shot.sh <out.png> <seconds> [launch arguments…]42# Installs the Debug build on the dedicated simulator, launches it with the given -ORIX… arguments, waits, takes a screenshot.43# Provider keys present in the environment (OPENAI_API_KEY…) are passed to the app process only; they are held in memory there.44set -euo pipefail45cd "$(dirname "$0")/.."46SIM="${ORIX_SIM:-ORIXAstra iPhone}"47OUT="$1"; WAIT="$2"; shift 248APP="build/dd/Build/Products/Debug-iphonesimulator/ORIXAstra.app"49xcrun simctl bootstatus "$SIM" -b >/dev/null 2>&1 || xcrun simctl boot "$SIM" >/dev/null 2>&1 || true50xcrun simctl bootstatus "$SIM" -b >/dev/null51xcrun simctl status_bar "$SIM" override --time "9:41" --batteryState charged --batteryLevel 100 --cellularBars 4 --wifiBars 3 >/dev/null 2>&1 || true52xcrun simctl terminate "$SIM" ai.spboucher.orix.astra >/dev/null 2>&1 || true53xcrun simctl install "$SIM" "$APP"54for v in OPENAI_API_KEY ANTHROPIC_API_KEY GEMINI_API_KEY XAI_API_KEY OPENROUTER_API_KEY; do55 if [ -n "${!v:-}" ]; then export "SIMCTL_CHILD_$v=${!v}"; fi56done57xcrun simctl launch "$SIM" ai.spboucher.orix.astra "$@" >/dev/null58sleep "$WAIT"59mkdir -p "$(dirname "$OUT")"60xcrun simctl io "$SIM" screenshot "$OUT" >/dev/null 2>&161echo "$OUT"62