Shopify launches Reflex architecture, letting Agents verify native App behavior without simulators
English text is being prepared.
Shopify Engineering has released Reflex, a mobile application architecture for AI coding that separates business logic from the UI, letting Agents read JSON state, execute actions, and verify results via the command line without starting a device or simulator. iOS and Android still use Swift and Kotlin respectively to write native code, but they share the same set of behavior tests, and changes can only be merged if both platforms pass. Shopify says that more than 1,700 behavior tests run in about 4 minutes across both platforms in the continuous integration environment, take only a few hundred milliseconds to run without a device, while the same test takes about 2 seconds on the iOS simulator. Reflex does not verify pixels, nor can it prove that a button is correctly connected to the corresponding action, and it is currently not an open-source library that can be installed directly; teams need to implement the architecture and adaptation layer themselves.
Why read this
AI score 54
The original article provides the architecture layers, command-line verification methods, and dual-platform test durations, offering a look at one engineering solution for the verification step in AI coding.
Topics
View original postWe rebuilt our mobile apps in Swift and Kotlin with agents. To keep pace and hold our quality bar, we built Reflex: an agentic-first architecture that lets agents build and verify app behavior across iOS and Android without needing devices or simulators. Here's how it works, piece by piece: https://t.co/Eaxae98QXS
View original
We rebuilt our mobile apps in Swift and Kotlin with agents. To keep pace and hold our quality bar, we built Reflex: an agentic-first architecture that lets agents build and verify app behavior across iOS and Android without needing devices or simulators. Here's how it works, piece by piece: https://t.co/Eaxae98QXS
Body
Shopify Reflex:让 AI 不靠模拟器,也能验证原生 App 的行为
来自 Shopify Engineering 博客,Reflex 是 Shopify 为 AI 编程设计的移动应用架构:把业务逻辑与界面分开,让 Agent 通过命令行直接读取状态、执行操作和验证结果。iOS、Android 仍分别写原生代码,但共享行为测试。
# 瓶颈从写代码变成验证
Agent 几分钟就能写出一个页面,但验证仍要启动模拟器、构建应用、模拟点击。Shopify 即使改进了模拟器工具,也碰到了速度上限。
Reflex 的思路不是继续加速点击,而是让应用本身提供一种不启动界面也能运行和检查的方式。
# 核心机制:直接操作界面背后的状态
应用核心层不依赖界面和设备,可以直接在 macOS 或 JVM 上运行。每个页面的 ViewModel(管理页面状态和操作的组件)都暴露统一接口:当前状态、可执行动作,以及子组件。
Agent 通过命令行发送动作,再读取 JSON 状态,验证业务逻辑、输入校验、导航和错误处理。它运行的是真实业务代码,而不是另一套模拟实现;网络等外部依赖则用预设数据替代,行为测试还会强制阻止真实 HTTP 请求。
关键原则是 “共享测试,而不是共享代码”:Swift 和 Kotlin 各自实现,同一份行为测试在两端运行,两边都通过才能合入。这样既保留原生实现,也用测试约束双端行为一致。
# 效果与边界
Shopify 报告,超过 1,700 条行为测试在持续集成环境中双端约 4 分钟跑完。文中示例在预热后,无设备运行只需几百毫秒,同一测试在 iOS 模拟器上约需 2 秒。
但它不验证像素,也不能证明界面按钮正确连接到了对应操作。视觉检查仍靠设计系统对照、少量截图测试和实际使用。Reflex 目前也不是可直接安装的开源库,团队需要自行实现这套架构和适配层。
AI Trends