SuperAPI AI 工具集

asc-screenshot-resize

编程与开发

查看项目

更新于 10-15 23:34

技能介绍

用途:为 App Store Connect 准备、调整和校验应用截图,适合在批量处理或修复截图尺寸、透明通道时使用。

主要能力:通过 asc 命令查询当前接受的截图尺寸与设备类型,使用 macOS sips 检查像素尺寸、透明通道和色彩空间,去除 alpha 透明通道,按目标尺寸缩放,并在上传前用 asc 校验。

必要用法:先查询尺寸,例如 asc screenshots sizes --output table 或 asc screenshots sizes --all --output table;校验用 asc screenshots validate --path "./screenshots/iphone" --device-type "IPHONE_65" --output table。常见设备锚点包括 IPHONE_65 和 IPAD_PRO_3GEN_129,其他显示类型需运行 asc screenshots sizes --all。处理前可先清理文件名中的隐藏 Unicode 空格;用 sips -g pixelWidth -g pixelHeight 检查尺寸,用 sips -s format jpeg 再转回 png 去除 alpha;缩放时 sips -z 先高度后宽度,例如 sips -z 2778 1284 input.png --out output.png。上传前先 dry-run:asc screenshots upload --version-localization "LOC_ID" --path "./resized" --device-type "IPHONE_65" --dry-run --output table。

限制:尺寸要求以 asc screenshots sizes --all 为准,Apple 要求会变化;截图须为 PNG 或 JPEG 且不能含 alpha 透明;避免跨不兼容宽高比拉伸;始终输出到单独文件或目录以保留原图;必要时用 sips -m 转换为 sRGB。上传前优先使用 asc screenshots validate 而非目视检查。