#!/usr/bin/env bash
set -euo pipefail
# Run from each commit's installed worktree with its Metro serving the dev client.
# SESSION is the already-leased Pixel 9 Android API 36 session.
# OUT is a fresh directory for this run's captures.
: "${SESSION:?}" "${OUT:?}"
mkdir -p "$OUT"
agent-device record start "$OUT/deep-link.mp4" --session "$SESSION"
agent-device open com.t3tools.t3code.dev 't3code-dev://pair?pairingUrl=https%3A%2F%2Fexample-host.test%2Fpair%23token%3DABCD1234' --session "$SESSION"
agent-device snapshot -i --session "$SESSION"
agent-device screenshot "$OUT/result-1.png" --normalize-status-bar --session "$SESSION"
sleep 0.5
agent-device screenshot "$OUT/result-2.png" --normalize-status-bar --session "$SESSION"
agent-device record stop --session "$SESSION"
