Show HN:我们为 Maestro 增加了 iOS 真机支持

1作者: omnarayan19 天前
自 2023 年 1 月以来,iOS 真机支持一直是 Maestro 最受期待的功能。GitHub 上近三年来一直有用户提出同样的需求,相关的 issue 和评论不计其数。 由于我们自己的工作也需要这个功能,所以我们构建了它并提交了 PR #2856。但 Maestro 团队表示,官方支持要到明年才会推出——而且没有确定的时间表。 我们不想让团队苦等,所以我们打包了一个可以立即使用的独立工具。 工作原理: - maestro-ios-device 构建并将 XCTest 运行器部署到您的物理 iPhone 上 - 端口转发桥接 localhost:6001 → device:22087 - 您现有的 Maestro YAML 文件无需更改 额外福利:我们还解锁了在多个真机设备上的并行执行。Maestro 之前有硬编码的端口限制——现在您可以在设备 1 上使用 :6001 端口,在设备 2 上使用 :6002 端口同时运行。 限制(苹果的限制): - clearState 通过重新安装应用程序实现(而不是 simctl) - setLocation 需要额外的设置 - 不支持 addMedia 安装: curl -fsSL <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;devicelab-dev&#x2F;maestro-ios-device&#x2F;main&#x2F;setup.sh" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;devicelab-dev&#x2F;maestro-ios-...</a> | bash 仓库:<a href="https:&#x2F;&#x2F;github.com&#x2F;devicelab-dev&#x2F;maestro-ios-device" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;devicelab-dev&#x2F;maestro-ios-device</a> PR:<a href="https:&#x2F;&#x2F;github.com&#x2F;mobile-dev-inc&#x2F;Maestro&#x2F;pull&#x2F;2856" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mobile-dev-inc&#x2F;Maestro&#x2F;pull&#x2F;2856</a> 已在 iOS 18.x 和 26.x 以及 Maestro 2.0.9/2.0.10 上测试。 这是一个非官方版本——当 Maestro 发布原生支持时,请使用官方版本。 欢迎就此实现提出问题。
查看原文
iOS real device support has been Maestro&#x27;s most requested feature since January 2023. Almost 3 years of GitHub issues and comments asking for the same thing.<p>We needed it for our work, so we built it and submitted PR #2856. But the Maestro team said official support won&#x27;t land until next year — no committed timeline.<p>We didn&#x27;t want teams to wait, so we packaged a standalone tool that works today.<p>How it works: - maestro-ios-device builds and deploys the XCTest runner to your physical iPhone - Port forwarding bridges localhost:6001 → device:22087 - Your existing Maestro YAML runs unchanged<p>Bonus: We also unlocked parallel execution on multiple real devices. Maestro had a hardcoded port limitation — now you can run on device 1 at :6001 and device 2 at :6002 simultaneously.<p>Limitations (Apple restrictions): - clearState works via app reinstall (not simctl) - setLocation requires additional setup - addMedia not supported<p>Install: curl -fsSL <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;devicelab-dev&#x2F;maestro-ios-device&#x2F;main&#x2F;setup.sh" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;devicelab-dev&#x2F;maestro-ios-...</a> | bash<p>Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;devicelab-dev&#x2F;maestro-ios-device" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;devicelab-dev&#x2F;maestro-ios-device</a> PR: <a href="https:&#x2F;&#x2F;github.com&#x2F;mobile-dev-inc&#x2F;Maestro&#x2F;pull&#x2F;2856" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mobile-dev-inc&#x2F;Maestro&#x2F;pull&#x2F;2856</a><p>Tested on iOS 18.x and 26.x with Maestro 2.0.9&#x2F;2.0.10.<p>This is unofficial — when Maestro ships native support, use that instead. Happy to answer questions about the implementation.