on d1663a6 help sign in
skrepka/client/run-ios.sh
31 lines 838 B history raw
1#!/bin/bash
2set -e
3cd "$(dirname "$0")"
5DEVICE="${1:-iPhone 17 Pro}"
6BUNDLE_ID="com.skrepka.client"
7APP="bin/Debug/net10.0-ios/iossimulator-arm64/Skrepka.app"
9dotnet build Skrepka.fsproj -f net10.0-ios -r iossimulator-arm64
11UDID=$(xcrun simctl list devices available -j | python3 -c "
12import json, sys
13devices = json.load(sys.stdin)['devices']
14name = '$DEVICE'
15for runtime, devs in devices.items():
16 for d in devs:
17 if d['name'] == name and d['isAvailable']:
18 print(d['udid']); sys.exit()
19print('', end=''); sys.exit(1)
20")
22if [ -z "$UDID" ]; then
23 echo "Simulator '$DEVICE' not found. Available:"
24 xcrun simctl list devices available | grep -i iphone
25 exit 1
26fi
28xcrun simctl boot "$UDID" 2>/dev/null || true
29open -a Simulator
30xcrun simctl install "$UDID" "$APP"
31xcrun simctl launch "$UDID" "$BUNDLE_ID"