SuperAPI AI 工具集

asc-screenshot-resize

编程与开发

查看项目

更新于 10-16 09:52

技能介绍

用途:为 App Store Connect 准备截图,包括校验尺寸、去除透明通道、按需缩放并上传。尺寸规范以 CLI 为准,技能内不写死尺寸表。

主要能力与用法:先用 asc 获取当前可用尺寸:asc screenshots sizes --output table 或 asc screenshots sizes --all --output table。上传前用 asc screenshots validate --path "./screenshots/iphone" --device-type "IPHONE_65" --output table 做本地校验,iPad 用 IPAD_PRO_3GEN_129;其他显示类型(6.9 英寸 iPhone、Apple TV、Mac、Vision Pro、iMessage、Watch)用 --all 查询。

流程:先清理文件名中的隐藏 Unicode 空格,可用资料给出的 python3 脚本批量重命名;用 sips -g pixelWidth -g pixelHeight screenshot.png 检查尺寸与元数据。App Store Connect 拒绝带 alpha 透明度的截图,可通过 JPEG 往返去除:sips -s format jpeg input.png --out /tmp/asc-screenshot-no-alpha.jpg 再转回 PNG。批量去透明、缩放均可参考资料中的 shell 循环。缩放要在选定目标尺寸后进行,注意 sips -z 先高后宽。完成后用 sips 复查尺寸与 hasAlpha,再用 asc screenshots validate 校验,最后上传:asc screenshots upload --version-localization "LOC_ID" --path "./resized" --device-type "IPHONE_65" --dry-run --output table,确认后再去掉 --dry-run。

限制与注意:sips 命令适用于 macOS;尺寸以 asc screenshots sizes --all 为权威,Apple 规范会变;不要跨不兼容宽高比拉伸截图;始终输出到单独文件或目录以保留原图;截图须为 PNG 或 JPEG 且不含 alpha;必要时用 sips -m 将 Display P3 等转为 sRGB;上传前优先使用 validate 而非目视检查。