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
iphone_type_text: support replace: true through WDA #161
#159 adds replace: true to iphone_type_text (replace the focused field's text, or empty it with empty text; Return is pressed only after the field reads back as exactly the new text). It only works with native control (iOS 27+, no WDA). Through WDA it refuses with "Replacing text requires native control" and types nothing. It does not fall back to typing at the cursor, which is the behavior we want to keep.
So phones driven through WDA (iOS 26 and earlier, or ICTL_IOS_BACKEND=wda) can't replace or empty a field. Agents fall back to typing at the cursor and get wifi 蓝牙, the problem #158 started from.
Proposal
Implement ReplaceText in the WDA path of the daemon with WDA's element endpoints:
GET /session/:id/element/active → the focused element (refuse when there is none, or it isn't a TextField / SearchField / TextView; refuse SecureTextField as the native path does).
POST /session/:id/element/:uuid/clear.
Non-empty text: POST /session/:id/element/:uuid/value (or /wda/keys, which type_text already uses and verifies).
Read the same element's value back and compare it with text exactly, with the same placeholder rule as the native path (an empty field may report its placeholder as its value). Only then press Return for submit.
On failure after clear, say so plainly: unlike the native path there is no selection to undo, the old text is gone.
Notes:
clear doesn't work in some custom fields; fall back to select all (/wda/keys with Cmd-A isn't available on a software keyboard), or refuse with a clear message, but never report success without the read-back.
Tests: tests/device/scenarios.py editing already covers wifi → wi → 蓝牙 → empty, and skips on WDA. It should run there once this lands.
Activity