SuperAPI AI 工具集

asc-metadata-sync

编程与开发

查看项目

更新于 10-16 10:34

技能介绍

用途

asc-metadata-sync 用于让本地元数据与 App Store Connect 保持一致。适用场景是更新应用元数据或翻译内容时使用,并包含旧版元数据格式的迁移。

两类本地化

1. 版本本地化(按发布版本)

涉及字段:description、keywords、whatsNew、supportUrl、marketingUrl、promotionalText。

列出本地化:

asc localizations list --version "VERSION_ID"

下载:

asc localizations download --version "VERSION_ID" --path "./localizations"

从 .strings 文件上传:

asc localizations upload --version "VERSION_ID" --path "./localizations"

2. 应用信息本地化(应用级)

涉及字段:name、subtitle、privacyPolicyUrl、privacyChoicesUrl、privacyPolicyText。

先查找 app info ID:

asc apps info list --app "APP_ID"

列出应用信息本地化:

asc localizations list --app "APP_ID" --type app-info --app-info "APP_INFO_ID"

上传应用信息本地化:

asc localizations upload --app "APP_ID" --type app-info --app-info "APP_INFO_ID" --path "./app-info-localizations"

注意:若出现 "multiple app infos found",必须用正确的 ID 指定 --app-info。

旧版 Fastlane 元数据工作流

导出当前状态:

asc migrate export --app "APP_ID" --version-id "VERSION_ID" --output-dir "./fastlane"

校验本地文件:

asc migrate validate --fastlane-dir "./fastlane"

该命令检查字符限制与必填字段。

导入更新:

asc migrate import --app "APP_ID" --version-id "VERSION_ID" --fastlane-dir "./fastlane" --dry-run
asc migrate import --app "APP_ID" --version-id "VERSION_ID" --fastlane-dir "./fastlane"

快速字段更新

版本特定字段:

# What's New
asc apps info edit --app "APP_ID" --locale "en-US" --whats-new "Bug fixes and improvements"

# Description
asc apps info edit --app "APP_ID" --locale "en-US" --description "Your app description here"

# Keywords
asc apps info edit --app "APP_ID" --locale "en-US" --keywords "keyword1,keyword2,keyword3"

# Support URL
asc apps info edit --app "APP_ID" --locale "en-US" --support-url "https://support.example.com"

版本元数据:

# Copyright
asc versions update --version-id "VERSION_ID" --copyright "2026 Your Company"

# Release type
asc versions update --version-id "VERSION_ID" --release-type AFTER_APPROVAL

TestFlight 说明:

asc build-localizations create --build "BUILD_ID" --locale "en-US" --whats-new "TestFlight notes here"

.strings 文件格式

批量更新可使用 .strings 文件:

// en-US.strings
"description" = "Your app description";
"keywords" = "keyword1,keyword2,keyword3";
"whatsNew" = "What's new in this version";
"supportUrl" = "https://support.example.com";

app-info 类型:

// en-US.strings (app-info type)
"privacyPolicyUrl" = "https://example.com/privacy";
"name" = "Your App Name";
"subtitle" = "Your subtitle";

多语言工作流

导出全部本地化:

asc localizations download --version "VERSION_ID" --path "./localizations"

翻译 .strings 文件(或使用翻译服务)。

一次性上传全部:

asc localizations upload --version "VERSION_ID" --path "./localizations"

验证:

asc localizations list --version "VERSION_ID" --output table

字符限制

字段 限制
Name 30
Subtitle 30
Keywords 100(逗号分隔)
Description 4000
What's New 4000
Promotional Text 170

对规范的元数据树使用 asc metadata validate --dir "./metadata"。 对旧版 fastlane 格式元数据使用 asc migrate validate --fastlane-dir "./fastlane"。

注意事项

  • 版本本地化与应用信息本地化不同;需使用正确的命令与 --type 标志。
  • 使用 asc localizations list 确认可用的语言区域与 ID。
  • 隐私政策 URL 位于应用信息本地化中,而非版本本地化中。