SuperAPI AI 工具集

appshots-maestro-capture

通用与其它

查看项目

更新于 10-16 05:53

技能介绍

用途:用 Maestro CLI 自动化移动应用界面操作并截图,覆盖 Flutter、SwiftUI、UIKit、Jetpack Compose、Android XML、React Native 等框架,同一 YAML 流程可同时用于 iOS 与 Android。

主要能力:声明式 YAML 编写流程;自动等待元素出现而非手动 sleep;基于语义标识符定位元素(id、text、label 及 below/above/leftOf/rightOf/containedIn 相对选择器);内置重试;内置 takeScreenshot;支持 scrollUntilVisible、extendedWaitUntil、tapOn、longPressOn、swipe、inputText、assertVisible、clearState 等命令;提供 maestro studio 交互式查看 UI 树并生成 YAML;附带多语言并行截图脚本示例。

使用方式:安装 CLI:curl -fsSL "https://get.maestro.mobile.dev" | bash,并执行 export PATH="$PATH:$HOME/.maestro/bin",用 maestro --version 验证。注意不要用 brew install maestro,那会安装代码编辑器而非移动测试 CLI。在项目根目录创建 .maestro/ 目录,每个流程为 .yaml 文件,以 appId 指定包名;运行示例:maestro test .maestro/capture_home.yaml、maestro test .maestro/、maestro test --device <UDID> 以及 maestro test --test-output-dir ./screenshots/raw .maestro/capture_home.yaml。

适用场景:为应用商店或设计交付批量截取各页面、多语言截图;用 maestro studio 先验证选择器再写入流程。

限制:建议优先使用 id 而非 text;需要应用提供可访问性标识符,具体各框架设置见配套技能;无 Maestro 支持的特定模拟器交互或需要原始可访问性树 JSON、或 CI 不支持 Maestro 时,才回退到 AXe。资料未提供收费、价格与效果数据。