mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
feat(companion): add appState, eraseText, pressKey runner handlers
The Go runner transport already calls these methods; the in-device runner implemented them only latently. They become load-bearing on the device path, where the hybrid's legacy-companion fallback is absent. Backward compatible: the simulator hybrid never calls them.
This commit is contained in:
1 parent
e04631d4c9
commit
99ae7c9294
3 files changed
+70
No files matched your search
@@ -122,6 +122,19 @@ final class Server {
|
||||
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
|
||||
try TextInput.type(text: text, replace: replace, bundleIdentifier: bundleIdentifier)
|
||||
return ["ok": true]
|
||||
case "eraseText":
|
||||
let count = params["count"] as? Int ?? 0
|
||||
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
|
||||
try TextInput.erase(count: count, bundleIdentifier: bundleIdentifier)
|
||||
return ["ok": true]
|
||||
case "pressKey":
|
||||
let key = params["key"] as? String ?? ""
|
||||
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
|
||||
try TextInput.pressKey(key: key, bundleIdentifier: bundleIdentifier)
|
||||
return ["ok": true]
|
||||
case "appState":
|
||||
let bundleIdentifier = params["bundleId"] as? String ?? currentBundleIdentifier
|
||||
return ["state": AppLifecycle.state(bundleIdentifier: bundleIdentifier)]
|
||||
case "screenshot":
|
||||
return try screenshot()
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user