Skip to content

20 AI testers on 20 different phones, in parallel, on GitHub's free runners: Claude Code agents on iOS Simulators and Android emulators that find broken flows, translation, layout and accessibility bugs

Optional screen recording of each phone

Pierre RAFFALLI78373811e620
diff --git a/.github/workflows/agent-testers.yml b/.github/workflows/agent-testers.yml
index 67641d5..743f4d0 100644
--- a/.github/workflows/agent-testers.yml
+++ b/.github/workflows/agent-testers.yml
@@ -50,6 +50,10 @@ on:
block_hosts:
description: Hosts the app must not reach during tests (analytics, ads), space-separated
default: "app.posthog.com eu.i.posthog.com us.i.posthog.com graph.facebook.com api.mixpanel.com api2.amplitude.com"
+ record_video:
+ description: Record each phone's screen (encrypted with the results)
+ type: boolean
+ default: false
permissions:
contents: read
@@ -221,6 +225,7 @@ jobs:
BRIEF: ${{ inputs.brief }}
MODEL: ${{ inputs.model }}
BLOCK_HOSTS: ${{ inputs.block_hosts }}
+ RECORD_VIDEO: ${{ inputs.record_video }}
with:
api-level: ${{ matrix.api }}
target: google_apis
@@ -312,6 +317,7 @@ jobs:
BRIEF: ${{ inputs.brief }}
MODEL: ${{ inputs.model }}
BLOCK_HOSTS: ${{ inputs.block_hosts }}
+ RECORD_VIDEO: ${{ inputs.record_video }}
run: bash scripts/ios/run_agent.sh
- name: Encrypt results
diff --git a/scripts/android/run_agent.sh b/scripts/android/run_agent.sh
index 9f0f6b6..04f84c0 100755
--- a/scripts/android/run_agent.sh
+++ b/scripts/android/run_agent.sh
@@ -24,9 +24,31 @@ adb shell settings put system font_scale "${FONT_SCALE:-1.0}"
adb emu geo fix "${GEO#*,}" "${GEO%,*}" >/dev/null 2>&1 # longitude first
adb shell monkey -p "$APP_ID" -c android.intent.category.LAUNCHER 1 >/dev/null 2>&1
adb logcat -c; sleep 5
-# 4. The agent: only the listed tools, nothing else
+# 4. Optional screen recording, kept in results/ (encrypted like the rest)
+REC=""
+if [ "${RECORD_VIDEO:-false}" = true ]; then
+ adb shell settings put system show_touches 1
+ SZ=$(adb shell wm size | grep -oE '[0-9]+x[0-9]+' | tail -1); W=${SZ%x*}; H=${SZ#*x}
+ RW=$((W * 2 / 3 / 16 * 16)); RH=$((H * RW / W / 16 * 16)) # 2/3 size, multiples of 16 for the encoder
+ rm -f /tmp/stop-rec
+ # screenrecord stops at 180 s: chain files until the agent is done
+ ( i=0; opt="--size ${RW}x${RH}"
+ while [ ! -f /tmp/stop-rec ] && [ $i -lt 40 ]; do
+ i=$((i + 1)); t0=$(date +%s)
+ adb shell screenrecord $opt --bit-rate 4000000 --time-limit 180 "/sdcard/rec_$(printf %02d $i).mp4"
+ [ $(($(date +%s) - t0)) -lt 3 ] && opt="" # size refused: native size
+ done ) &
+ REC=$!
+fi
+# 5. The agent: only the listed tools, nothing else
claude -p "Read $BRIEF and personas.json, then do the mission until the final report. PERSONA=$PERSONA PLATFORM=android APP_ID=$APP_ID. Device: ${DEVICE}, font scale x${FONT_SCALE:-1.0}, theme ${THEME:-light}, language $LOCALE. Report anything that does not fit this screen (cut text, off-screen buttons, broken layout)." \
--model "${MODEL:-sonnet}" --max-turns 400 --output-format json \
--allowedTools "Bash(adb:*),Bash(python3 scripts/android/screen.py:*),Bash(python3 scripts/android/type.py:*),Bash(sleep:*),Bash(ls:*),Bash(cat:*),Bash(mkdir:*),Read,Write,Edit" \
> results/agent-output.json 2> results/agent-errors.txt
-echo "Agent finished (exit $?), $(ls "results/$PERSONA" | wc -l) files"
+CODE=$?
+if [ -n "$REC" ]; then
+ touch /tmp/stop-rec; adb shell pkill -INT screenrecord; sleep 4; kill "$REC" 2>/dev/null
+ mkdir -p "results/$PERSONA/video"
+ for f in $(adb shell ls /sdcard/ | tr -d '\r' | grep '^rec_'); do adb pull "/sdcard/$f" "results/$PERSONA/video/" >/dev/null 2>&1; done
+fi
+echo "Agent finished (exit $CODE), $(ls "results/$PERSONA" | wc -l) files"
diff --git a/scripts/ios/run_agent.sh b/scripts/ios/run_agent.sh
index 2cf28c7..69f4e64 100755
--- a/scripts/ios/run_agent.sh
+++ b/scripts/ios/run_agent.sh
@@ -14,8 +14,22 @@ xcrun simctl install "$UDID" "$(find app -maxdepth 2 -name '*.app' -type d | hea
xcrun simctl launch "$UDID" "$APP_ID"; sleep 8
# First capture stores the screen width in points for gesture.sh
python3 scripts/ios/screen.py "$RUNNER_TEMP/warmup" 00 >/dev/null 2>&1 || true
+# Optional screen recording, kept in results/ (encrypted like the rest)
+REC=""
+if [ "${RECORD_VIDEO:-false}" = true ]; then
+ mkdir -p "results/$PERSONA/video"
+ set -m # own process group: a background job of a script would ignore the SIGINT that ends the file
+ xcrun simctl io "$UDID" recordVideo --codec=h264 --force "results/$PERSONA/video/rec_01.mp4" > "$RUNNER_TEMP/rec.log" 2>&1 &
+ REC=$!; set +m; sleep 2
+fi
claude -p "Read $BRIEF and personas.json, then do the mission until the final report. PERSONA=$PERSONA PLATFORM=ios APP_ID=$APP_ID. Device: $DEVICE, text size ${TEXT_SIZE:-large}, theme ${THEME:-light}, language $LOCALE. The simulator is already booted and the tools find it on their own (UDID is set): use the commands of the brief directly. Report anything that does not fit this screen (cut text, off-screen buttons, under the notch or home bar, broken layout)." \
--model "${MODEL:-sonnet}" --max-turns 400 --output-format json \
--allowedTools "Bash(bash scripts/ios/gesture.sh:*),Bash(python3 scripts/ios/screen.py:*),Bash(python3 scripts/ios/type.py:*),Bash(sleep:*),Bash(ls:*),Bash(cat:*),Bash(mkdir:*),Read,Write,Edit" \
> results/agent-output.json 2> results/agent-errors.txt
-echo "Agent finished (exit $?), $(ls "results/$PERSONA" | wc -l) files"
+CODE=$?
+if [ -n "$REC" ]; then
+ kill -INT "$REC" 2>/dev/null
+ for i in $(seq 1 30); do kill -0 "$REC" 2>/dev/null || break; sleep 1; done
+ cat "$RUNNER_TEMP/rec.log"; ls -l "results/$PERSONA/video"
+fi
+echo "Agent finished (exit $CODE), $(ls "results/$PERSONA" | wc -l) files"