7474 xcrun simctl bootstatus "$UDID"
7575 echo "SIMULATOR_UDID=$UDID" >> "$GITHUB_ENV"
7676
77+ - name : Disable keyboard intelligence on the simulator
78+ run : |
79+ KEYS=(
80+ KeyboardPrediction
81+ KeyboardAutocorrection
82+ KeyboardCheckSpelling
83+ KeyboardAutocapitalization
84+ KeyboardPeriodShortcut
85+ KeyboardCapsLock
86+ KeyboardContinuousPathEnabled
87+ )
88+ for key in "${KEYS[@]}"; do
89+ xcrun simctl spawn "$SIMULATOR_UDID" defaults write "Apple Global Domain" "$key" -bool false
90+ xcrun simctl spawn "$SIMULATOR_UDID" defaults write com.apple.Preferences "$key" -bool false
91+ done
92+ # Suppress the slide-to-type intro overlay a fresh sim shows on first keyboard use
93+ xcrun simctl spawn "$SIMULATOR_UDID" defaults write com.apple.keyboard.preferences \
94+ DidShowContinuousPathIntroduction -bool true
95+ xcrun simctl spawn "$SIMULATOR_UDID" defaults read "Apple Global Domain" | grep Keyboard || true
96+
7797 - name : Install app on simulator
7898 run : |
7999 echo "Installing $APP_PATH on $SIMULATOR_UDID"
@@ -82,12 +102,50 @@ jobs:
82102 - name : Install Argent and start the tool-server
83103 uses : ./.github/actions/argent-server
84104
105+ # h264 rather than the default hevc, which most browsers cannot play.
106+ - name : Start screen recording
107+ run : |
108+ mkdir -p "$RUNNER_TEMP/e2e-debug/recordings"
109+ nohup xcrun simctl io "$SIMULATOR_UDID" recordVideo --codec h264 --force \
110+ "$RUNNER_TEMP/e2e-debug/recordings/rec.mp4" > recordvideo.log 2>&1 &
111+ echo "RECORDING_PID=$!" >> "$GITHUB_ENV"
112+ # simctl only records from the first processed frame, which it
113+ # announces; without the wait the tests start before the recording.
114+ for _ in $(seq 1 30); do
115+ if grep -q "Recording started" recordvideo.log 2>/dev/null; then break; fi
116+ sleep 1
117+ done
118+
85119 - name : Run E2E tests
86120 run : argent flow run ./.argent/flows --device $SIMULATOR_UDID
87121
122+ - name : Stop screen recording
123+ if : ${{ always() }}
124+ run : |
125+ # SIGINT is what makes recordVideo write the mp4 trailer; killed any
126+ # other way, the file is unplayable.
127+ kill -INT "${RECORDING_PID:-}" 2>/dev/null || true
128+ for _ in $(seq 1 15); do
129+ kill -0 "${RECORDING_PID:-}" 2>/dev/null || break
130+ sleep 1
131+ done
132+
88133 # The tool-server log also carries the device backend's stderr
89134 # (`[sim <udid>]` lines), where a failed connection to the simulator is
90135 # explained.
91- - name : Print Argent tool-server log
136+ - name : Collect logs
137+ if : ${{ always() }}
138+ run : |
139+ mkdir -p "$RUNNER_TEMP/e2e-debug/logs"
140+ for f in recordvideo.log "${ARGENT_SERVER_LOG:-}"; do
141+ cp "$f" "$RUNNER_TEMP/e2e-debug/logs" 2>/dev/null || true
142+ done
143+ ls -lR "$RUNNER_TEMP/e2e-debug"
144+
145+ - name : Upload logs and screen recording
92146 if : ${{ !success() }}
93- run : cat "$ARGENT_SERVER_LOG" 2>/dev/null || echo "no Argent tool-server log"
147+ uses : actions/upload-artifact@v4
148+ with :
149+ name : e2e-ios-debug-${{ inputs.artifact-name }}
150+ path : ${{ runner.temp }}/e2e-debug/
151+ if-no-files-found : ignore
0 commit comments