iOS Simulator (iPad): press lands a fixed offset away in landscape (0,+52 left; +156,0 right) and reports success

未关闭
#4,091 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@thymikee 已经在做这个了。

开始于 2026年11月2日。

  • #4157 来自 @thymikee —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
ios, typescript
领域
mobile

调研方向

Start at the press command's touch-dispatch path and trace how it handles iOS Simulator coordinates after an orientation change. Reproduce on an iPad Simulator in both landscape orientations using the coordinates in the issue, then compare the dispatched touch location with the requested point. Done means presses land at the requested coordinates in portrait and landscape, including selector presses.

由索引模型根据 Issue 内容生成。

描述

bug in-progress ready-for-agent

Summary

On an iPad Simulator in landscape, every press lands a fixed distance away from the point asked for, and the command still reports success. The shift depends on the orientation. Portrait is exact. Snapshot rects are correct: the same element's rect from get attrs matches the accessibility frame from another tool, so only the dispatched touch is shifted.

Orientation press at App received the touch at Offset
portrait 120,300 / 600,250 / 760,700 120,300 / 600,250 / 760,700 0,0
landscape-left 120,300 / 600,250 / 300,760 120,352 / 600,302 / 300,812 0,+52
landscape-right 150,300 / 1000,250 306,300 / 1156,250 +156,0

How the landing point was measured: a passive UIGestureRecognizer on the app's key window (cancelsTouchesInView = false) records location(in: window) of every touch. For comparison, the same points tapped through idb/axe (HID) land exactly in every orientation.

Selector presses have the same shift, because they press the (correct) rect centre:

  • press 'label="Settings"' in landscape-left activated the row below it, 52 pt lower.
  • A popup menu pick selected the next menu item.

The settled diff then shows a change, so the wrong tap is reported as ok.

Repro

  1. Boot an iPad Simulator and open any app that fills the screen: agent-device open <bundle-id> --platform ios --udid <udid>.
  2. Rotate: agent-device orientation landscape-left. The app's window becomes 1180x820.
  3. Press a known point: agent-device press 120 300.
  4. The app receives the touch at (120, 352). In landscape-right, press 150 300 arrives at (306, 300).

Our workaround: press a clear spot, read where it landed, and subtract that offset from later presses. After that, taps land exactly in both landscape orientations, so the offset seems to be constant per orientation.

Environment

  • agent-device 0.21.34. The 0.21.35 notes list no related change.
  • Xcode 27.1 (27A9275), iOS 27.1 Simulator runtime, iPad (A16), macOS 27.0.1.
  • The app is a SwiftUI app with full-screen scenes (window "full", not windowed).

This may be related to #1511 (the physical-device unrotated touch space), but on the Simulator the shift is a translation, not a rotation.

主要语言
TypeScript
星标
5.2k
派生
359
平均合并
13 小时 31 分钟
30 天内合并 PR
664

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。