Repository Public License
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : ORIX Camera8# File : Scripts/sim.sh9# Description : Install the Debug build on a simulator, launch it with10# arguments, wait, and save a screenshot. usage: sim.sh11# <out.png> <seconds> [launch arguments…] ORIX_SIM selects12# the simulator.13# Module : Scripts14# Repository : https://git.spboucher.ai/orix-camera15# Project Website : https://www.orixlab.dev16# Created : 2026-11-2117# Last Modified : 2026-11-2118#19# Author : Simon-Pierre Boucher20# Position : Professor of Finance21# Institution : Université du Québec en Outaouais (UQO)22# Organization : SP Boucher23# Website : https://spboucher.ai24# Git : https://git.spboucher.ai25#26# Preferred Contact: support@spboucher.ai27# Technical Contact: dev@spboucher.ai28# Security/Admin : admin@spboucher.ai29#30# Copyright (c) 202631# Simon-Pierre Boucher32# All rights reserved where applicable. This file is governed by the33# applicable project license, copyright notices and relevant law.34# Existing third-party rights and notices remain unaffected.35#36# License : Proprietary, all rights reserved (see license file)37# License File : LICENSE38#39# Do not embed credentials, private keys, access tokens,40# certificates or confidential personal information.41#42# =============================================================================43# END OF SP BOUCHER SOURCE HEADER44# =============================================================================4546set -euo pipefail47cd "$(dirname "$0")/.."48SIM="${ORIX_SIM:-ORIXCamera iPhone}"49OUT="$1"; WAIT="$2"; shift 250APP="build/DerivedData/Build/Products/Debug-iphonesimulator/ORIXCamera.app"51xcrun simctl boot "$SIM" 2>/dev/null || true52xcrun simctl bootstatus "$SIM" -b >/dev/null 2>&1 || true53xcrun simctl terminate "$SIM" ai.spboucher.orix.camera 2>/dev/null || true54xcrun simctl install "$SIM" "$APP"55xcrun simctl launch "$SIM" ai.spboucher.orix.camera "$@" >/dev/null56sleep "$WAIT"57mkdir -p "$(dirname "$OUT")"58xcrun simctl io "$SIM" screenshot "$OUT" >/dev/null 2>&159echo "$OUT"60