#!/usr/bin/env bash
# Run from each revision; use the same leased Pixel 9 and Metro port sequentially.
# Prepare before leasing. All database data comes from seed.mjs.
vp run mobile:install android --prepare
agent-device connect proxy --daemon-base-url "$SIMLOCK_AGENT_DEVICE_URL" --session proof-28084
agent-device open --platform android --device 'Pixel 9' --session proof-28084
vp run mobile:install android --session proof-28084 --metro http://fs-19.tail131df4.ts.net:8081
# In separate tracked process, owning revision/apps/mobile:
# APP_VARIANT=development REACT_NATIVE_PACKAGER_HOSTNAME=fs-19.tail131df4.ts.net vp run dev:client --port 8081
agent-device open com.t3tools.t3code.dev 't3code-dev://expo-development-client/?url=http%3A%2F%2Ffs-19.tail131df4.ts.net%3A8081&disableAutoLaunch=1&disableFab=1' --relaunch --session proof-28084
# Pair through pair-mobile.sh once; shared synthetic environment ID/history.
agent-device settings appearance dark --session proof-28084
agent-device settings animations off --session proof-28084
agent-device settings text-size medium --session proof-28084
# Android reports font_scale 0.94; relaunch after changing it.
# Open Mobile citation proof using current snapshot refs.
# Capture full native screen twice, 500ms apart, with normalized status bar.
agent-device screenshot C-check.png --normalize-status-bar --session proof-28084
sleep 0.5
agent-device screenshot C.png --normalize-status-bar --session proof-28084
compare -metric AE C-check.png C.png null:
agent-device close --session proof-28084
