You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a3d69c2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios): send device back as a hold-free 200 ms fling, and select the General cell by id in the physical replay
The XCTest press-and-drag held at the edge for at least 0.1 s and moved at 500 px/s, which
iOS can cancel as a pop; a synthesized 200 ms fling to 0.9 of the width popped 10 of 10 on
an iPhone 17 Pro. The fling is resolved before the just-before sample and reads no tree.
The device contact allowance drops to 0.4 s; the still span still grows with the slowest
capture, so a 0.4 s device capture is covered on both sides of the gap check.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+SynthesizedInteractionTests.swift
+8-55Lines changed: 8 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -235,11 +235,10 @@ extension RunnerTests {
235
235
}
236
236
}
237
237
238
-
/// A device's back drag presses an XCTest coordinate only where the tree can anchor it. On a tree
239
-
/// XCTest cannot serialize it synthesizes the same path on the booked route: no tree anchor, no
240
-
/// coordinate press, which would raise and end the runner (#4221).
238
+
/// A device's back fling is synthesized on the booked route, so even on a tree XCTest cannot
239
+
/// serialize it presses no XCTest coordinate, which would raise and end the runner (#4221).
Copy file name to clipboardExpand all lines: apple/runner/RUNNER_PROTOCOL.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,12 +153,12 @@ contact, and one more sample, taken right before the swipe, must still match the
153
153
| Platform | Resolved before the last sample | Left in the gap | Contact allowance |
154
154
| --- | --- | --- | --- |
155
155
| Simulator | the edge-touch plan, its display, and the HID touchscreen sender | the 100 ms edge contact | 0.2 s |
156
-
| Device | the window anchor of the XCTest drag, or on a tree XCTest cannot serialize, the synthesized drag plan | the drag (a 0.05 s press then the move, or a 300 ms synthesized drag) | 0.65 s |
156
+
| Device | the synthesized fling plan (2 pt inside the leading edge to 0.9 of the width, no hold), which reads no tree | the 200 ms fling | 0.4 s |
157
157
158
158
Settling takes at most 8 samples, so the wait before the swipe is at most 1.75 s of delays plus
159
-
eight captures, then the preparation and the last sample. With the 0.1 s captures measured on a
160
-
local simulator that is about 2.6 s; a slower capture adds 8 times its extra time. Usually the
161
-
screen settles sooner: a still simulator screen after 3 samples, a still device screen after 3 or 4.
159
+
eight captures, then the preparation and the last sample: about 2.6 s with the 0.1 s captures of a
160
+
local simulator, and about 5 s with the 0.4 s captures of a physical iPhone. Usually a still screen
161
+
settles after 3 samples.
162
162
163
163
Only a change from the last sample to the sample after the swipe counts, and only when the time
164
164
between those two does not exceed the time the screen had been still; otherwise the result is
- `back` uses app-owned back navigation: the back keyevent on Android, the visible back control on macOS, and the Siri Remote Menu button on tvOS. `--in-app` names this default explicitly.
127
-
- On iOS, `back` is the left-edge back swipe, with or without `--in-app` or `--system`. It succeeds only when the app's screen, drawn as a 48×96 grayscale grid with its top 7 rows left out (in portrait, the status bar and Dynamic Island band, whether the status bar is shown or hidden; in landscape the iPhone status bar is hidden and the Dynamic Island sits at a side edge, outside those rows), differs in more than 1% of the remaining cells by more than 24 of 256 levels. A small spinner usually stays under that; a larger animation can still count as a change. The change counted is the one between the sample taken immediately before the swipe and the one taken about 0.25 s after it, so a screen that changes on its own inside that gap, after it looked still, can be misread as a back navigation; verify with `snapshot` when the screen has auto-advancing content. Before it swipes, it waits for the screen to stop changing: up to 8 samples 0.25 s apart, which is 1.75 s plus eight screen captures, about 2.6 s on a simulator and longer where captures are slower.
127
+
- On iOS, `back` is the left-edge back swipe, with or without `--in-app` or `--system`. It succeeds only when the app's screen, drawn as a 48×96 grayscale grid with its top 7 rows left out (in portrait, the status bar and Dynamic Island band, whether the status bar is shown or hidden; in landscape the iPhone status bar is hidden and the Dynamic Island sits at a side edge, outside those rows), differs in more than 1% of the remaining cells by more than 24 of 256 levels. A small spinner usually stays under that; a larger animation can still count as a change. The change counted is the one between the sample taken immediately before the swipe and the one taken about 0.25 s after it, so a screen that changes on its own inside that gap, after it looked still, can be misread as a back navigation; verify with `snapshot` when the screen has auto-advancing content. Before it swipes, it waits for the screen to stop changing: up to 8 samples 0.25 s apart, which is 1.75 s plus eight screen captures: about 2.6 s on a simulator and about 5 s on a physical iPhone.
128
128
- `reason: back_swipe_no_change`: the swipe was sent and the screen did not change. Press the visible back or close control.
129
129
- `reason: back_swipe_unverified`: the swipe may or may not have navigated, because the screen kept changing before the swipe, the swipe took longer than the screen had been still, or the screen could not be sampled after it. Check with `snapshot`.
130
130
- `reason: back_swipe_not_dispatched`: the swipe was refused before any touch went down, so nothing reached the device.
131
131
- If the app's screen cannot be captured before the swipe, `back` does not swipe: it refuses with `COMMAND_FAILED` and `details.runnerErrorCode` set to `APP_SCREEN_WINDOW_UNRESOLVED`, `APP_SCREEN_UNRESOLVED`, `APP_SCREEN_CAPTURE_UNRENDERABLE`, or `APP_SCREEN_OFF_LIT_PANEL`. Nothing is sent.
132
-
- A simulator sends the swipe as a screen-edge touch. A physical device has no such touch and drags from the leading edge instead; if that drag does not pop the screen, `back` refuses with `back_swipe_no_change`. visionOS has no back gesture and refuses before dispatch with `UNSUPPORTED_OPERATION`.
132
+
- A simulator sends the swipe as a screen-edge touch. A physical device has no such touch and sends a quick fling from the leading edge instead; if that fling does not pop the screen, `back` refuses with `back_swipe_no_change`. visionOS has no back gesture and refuses before dispatch with `UNSUPPORTED_OPERATION`.
133
133
- An app with a left-edge drawer may open the drawer instead of going back. When a back or close control is visible, press it by its ref.
134
134
- `back --system` sends system back input: the Android back keyevent, the iOS back swipe, or the tvOS Siri Remote Menu button. macOS has no system back, so it refuses before dispatch.
135
135
- `orientation portrait|portrait-upside-down|landscape-left|landscape-right` works on iOS and Android mobile targets only. On ADB-backed Android it turns auto-rotate off, and the lock persists after the session ends until something turns it back on. A foldable iPhone simulator (iPhone Duo) refuses `portrait-upside-down`, and refuses every rotation in a scoped simulator set (`--ios-simulator-device-set`).
0 commit comments