Skip to content

dsh-ios v0.1.0-rc.4

Pre-release
Pre-release

Choose a tag to compare

@finiking finiking released this 23 Aug 05:12
· 9 commits to main since this release

dsh-ios v0.1.0-rc.4

devicectl 列出的模拟器,终究还是模拟器。/ A simulator devicectl lists is still a simulator.

🐛 修复 / Fixed

  • 模拟器被误判为物理设备 / Simulators misclassified as physical devices — 新版 devicectl 会把 iOS 模拟器和真机一起列出,而 src/devicectl.ts 的两个解析器读遍了所有列,唯独没读区分二者的那一列。模拟器因此进了 realDevices,它的 udid 被路由到 WebDriverAgent 真机通道:ios_sim_boot 以"这是物理设备"为由拒绝启动、实时 serve-sim 面板一直空白、所有基于 udid 的工具(ios_sim_screenshot / ios_sim_interact / ios_sim_ui_tree / ios_sim_tap_element)统一报 WebDriverAgent 不可用。修复后两个解析器只在明确判定为模拟器时才剔除该条:realitysimulated(位于 hardwareProperties 或扁平 properties 映射)、visibilityClasssimulators、或文本输出的 Reality 列读到 simulated。/ Newer devicectl builds report iOS Simulators alongside physical devices, and both parsers read every column except the one that tells them apart. The simulator landed in realDevices, so its udid was routed down the WebDriverAgent path. Both parsers now drop a row only on an explicit simulated verdict.

    「只保留 physical」是更顺手却更错的写法:一台离线的 iPad 根本不上报 reality 字段,那样过滤会让真机从设备列表里凭空消失。/ Keeping only physical would have been the tempting filter and the wrong one: an offline iPad reports no reality field at all and would vanish from the device list entirely.

  • 文本回退里设备名混入主机名 / Hostname bled into the device name in the text fallbackHostname 列从不输出,却也从未参与列边界计算,于是文本解析出的每个设备名后面都拖着它的主机名。该列现在与其他列一同界定切片范围。/ Hostname was never emitted but never bounded Name either; it now joins the text parser's column boundaries.

🧪 验证 / Verification

  • 新增 scripts/dev-devicectl-smoke.mjs(12/12),纯 fixture 套件,不依赖 devicectl、模拟器或 USB 设备,可在任意机器上跑出相同结果;覆盖三种 JSON 判别形态、无 reality 字段的离线 iPad 回归防护、含与不含 Reality 列的两种文本表头。/ A new pure-fixture suite (12/12) that runs identically on any host, covering all three JSON discriminator shapes, the offline-iPad regression guard, and both text-table headers.
  • 全套测试 719 项通过、0 失败;typecheck 与 build 均绿;真机 listRealDevices 复核,iPhone 与离线 iPad 照常列出。/ The full suite passes 719 steps with zero failures; a real-device listRealDevices check still lists both the iPhone and the offline iPad.
  • 坦白一句:本次修复未在真实故障环境复现。手头 Xcode 26.6 的 devicectl 不列模拟器(特意启一个 iOS 26 模拟器验证过),正确性由上述 fixture 保证,真实验证有待 Xcode 27 环境。/ Honest caveat: the original failure was not reproduced here — Xcode 26.6's devicectl does not list simulators at all. Correctness rests on the fixtures above; confirmation on an Xcode 27 host is still welcome.

🙏 致谢 / Credit

感谢 @QiShu3#1 中的报告——根因已经追到两个解析器,判别字段与调用链都指得很准。/ Thanks to @QiShu3 for #1, which arrived with the root cause already traced to both parsers.

📦 安装 / Install

dsh plugin --profile web add @zseven-w/dsh-ios@next
dsh web

⚠️ 说明 / Notes

  • npm dist-tag: next
  • src/devicectl.ts 的设备列举路径受影响,其余工具行为不变。/ Only the device-listing path in src/devicectl.ts changed; every other tool behaves as before.

Full Changelog: v0.1.0-rc.3...v0.1.0-rc.4