SuperAPI AI 工具集

asc-shots-pipeline

测试与质量

查看项目

更新于 10-16 06:55

技能介绍

用途

asc-shots-pipeline 用于智能体驱动的 iOS 截图工作流:应用通过 Xcode CLI 工具构建并启动,界面由 AXe 驱动,截图最终通过 asc 上传。当前已实现的范围包括构建/运行、AXe 计划捕获、加框合成与上传。设备发现通过 asc screenshots list-frame-devices 内置提供。

主要能力

  • 构建与运行:使用 xcrun simctl 与 xcodebuild 在模拟器上构建、安装并启动应用。
  • 计划驱动捕获:通过 asc screenshots run --plan 按 .asc/screenshots.json 执行截图步骤,也可使用 AXe 原语(describe-ui、tap、type、screenshot)手工编排。
  • 加框:asc CLI 将加框固定到 Koubou 0.18.1,以保证输出确定性;支持 iphone-air(默认)、iphone-17-pro、iphone-17-pro-max、iphone-16e、iphone-17、mac 等设备值。
  • 审查与上传:提供 review-generate、review-open、review-approve,以及 plan/apply 流程用于已审查的多语言批次;上传通过 asc screenshots upload 完成。
  • 多语言与并行:按 UDID 为每个语言设置模拟器级区域默认值,并给出并行捕获与完整多语言流水线示例。

使用方式

  1. 先创建设置 JSON:.asc/shots.settings.json,包含 app(bundle_id、project、scheme、simulator_udid)、paths(plan、raw_dir、framed_dir)、pipeline(frame_enabled、upload_enabled)与 upload(version_localization_id、device_type、source_dir)等字段。若跳过加框,设置 frame_enabled 为 false,并将 upload.source_dir 指向 ./screenshots/raw。
  2. 构建并运行:使用 xcrun simctl boot、xcodebuild build、xcrun simctl install、xcrun simctl launch。若应用包路径与默认位置不同,可用 xcodebuild -showBuildSettings 查询。
  3. 捕获截图:优先使用 asc screenshots run --plan ".asc/screenshots.json" --udid "$UDID" --output json;计划文件包含 version、app(bundle_id、udid、output_dir)与 steps(如 launch、wait、screenshot)。
  4. 加框:先 pip install koubou==0.18.1 并验证 kou --version;若缺少设备边框,联网执行一次 kou setup-frames。随后用 asc screenshots frame 指定 --input、--output-dir、--device。
  5. 审查与上传:先 review-generate、review-open、review-approve;多语言已审查批次建议使用 asc screenshots plan 与 asc screenshots apply(带 --confirm)。上传使用 asc screenshots upload,指定 --version-localization、--path、--device-type。上传前可用 asc screenshots sizes 与 asc screenshots list 校验。
  6. 多语言:不要使用 xcrun simctl launch ... -e AppleLanguages 切换语言;应使用按 UDID 的模拟器级区域默认值(defaults write NSGlobalDomain AppleLanguages / AppleLocale),再配合 asc screenshots capture。若手动启动,可使用 -AppleLanguages "(de)" -AppleLocale de_DE 启动参数。
  7. 并行:每个语言对应一个模拟器 UDID,可用 bash 后台任务或 xargs -P 并行捕获,再并行加框,最后统一生成审查并逐语言上传。

适用场景

  • 需要由智能体自动完成 iOS 应用截图采集、加框与上传的流水线。
  • 需要多语言、多设备截图并希望并行加速的场景。
  • 需要在上传前进行审查与批次计划(plan/apply)以处理已有远程截图数量限制的场景。

限制与注意事项

  • 本地截图自动化命令在 asc cli 中仍属实验性,应在面向用户的交接说明中标注。
  • 加框固定依赖 Koubou 0.18.1;若出现版本错误需重新安装,若缺少设备边框需联网执行 kou setup-frames。
  • 运行命令前应始终用 --help 确认确切参数,并用 asc screenshots --help 复核命令路径,因为截图命令演进较快。
  • 机器步骤默认使用 JSON 输出以保持确定性;选择加框设备前建议先执行 asc screenshots list-frame-devices --output json;上传前确保截图文件存在;使用显式长参数(--app、--output、--version-localization 等)。
  • 反馈与问题提交地址:https://github.com/rorkai/App-Store-Connect-CLI/issues/new/choose。