关于 asc-builds-upload
asc-builds-upload 是通过 `asc` 命令行向 App Store Connect 上传构建并管理分发的技能,支持查看上传状态、管理 TestFlight 测试组、填写合规信息及关联版本。
主要功能
- 01上传 IPA 或 PKG 构建
- 02查看、列出和删除上传任务
- 03将构建加入或移出测试组
- 04填写加密合规信息
- 05将构建关联到应用版本
适用场景
- 01上传构建并等待处理完成
- 02向 TestFlight 测试组分发构建
- 03补充缺失的加密合规信息
- 04为 App Store 审核准备版本
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ tddworks/ asc-cli-skills --skill asc-builds-upload安装后在 Claude Code 中输入/asc-builds-upload确认已加载。
附带文件references/workflow.md
详细介绍
asc 构建上传
通过 App Store Connect 上传和分发构建版本。完整的端到端流程和错误处理请参阅 workflow.md。
命令
上传构建版本
asc builds upload \
--app-id <APP_ID> \
--file MyApp.ipa \
--version 1.0.0 \
--build-number 42 \
[--platform ios|macos|tvos|visionos] # auto-detected from extension
[--wait] # poll until processing completes
平台会自动检测:.pkg → macos,其他所有文件 → ios。
轮询状态
asc builds uploads get --upload-id <UPLOAD_ID>
asc builds uploads list --app-id <APP_ID>
asc builds uploads delete --upload-id <UPLOAD_ID>
TestFlight 分发
# Add build to a beta group
asc builds add-beta-group --build-id <BUILD_ID> --beta-group-id <GROUP_ID>
# Remove build from a beta group
asc builds remove-beta-group --build-id <BUILD_ID> --beta-group-id <GROUP_ID>
# Set "What's New" notes (creates or updates the localization)
asc builds update-beta-notes \
--build-id <BUILD_ID> \
--locale en-US \
--notes "Bug fixes and improvements."
导出合规性答案(ITSAppUsesNonExemptEncryption)
上传 IPA 时,如果 Info.plist 中未包含 ITSAppUsesNonExemptEncryption,ASC 会将构建版本标记为“缺少合规性”,并阻止 TestFlight 外部测试。请在上传后设置答案:
asc builds set-encryption-compliance --build-id <BUILD_ID> --uses-non-exempt-encryption true|false
false— 豁免(大多数仅使用 HTTPS/TLS、Apple 默认加密技术等的应用)。true— 使用非豁免加密技术 — 你还需要一个AppEncryptionDeclaration(目前只能通过 App Store Connect 网页界面管理)。
处于缺少合规性状态的构建版本会显示以下操作入口:
{
"id": "build-1",
"affordances": {
"setEncryptionCompliance": "asc builds set-encryption-compliance --build-id build-1 --uses-non-exempt-encryption <true|false>"
}
}
提供答案后,该操作入口会隐藏(Build 的 usesNonExemptEncryption 将变为非空值)。
将构建版本关联到版本
asc versions set-build --version-id <VERSION_ID> --build-id <BUILD_ID>
提交版本以供 App Store 审核前必须执行此操作。
解析 App ID
请参阅 project-context.md — 在询问用户或运行 asc apps list 前,先检查 .asc/project.json。
典型工作流
APP_ID=$(cat .asc/project.json 2>/dev/null | jq -r '.appId // empty')
# If empty: ask user or run `asc apps list | jq -r '.data[0].id'`
# 1. Get the next build number automatically
BUILD_NUMBER=$(asc builds next-number --app-id "$APP_ID" --version 1.2.0 --platform ios)
# 2. Upload and wait
asc builds upload --app-id "$APP_ID" --file MyApp.ipa \
--version 1.2.0 --build-number "$BUILD_NUMBER" --wait
# 3. Get the processed build ID
BUILD_ID=$(asc builds list --app-id $APP_ID | jq -r '.data[0].id')
# 4. Distribute to beta group
asc builds add-beta-group --build-id $BUILD_ID --beta-group-id $GROUP_ID
# 5. Set notes
asc builds update-beta-notes --build-id $BUILD_ID --locale en-US --notes "..."
# 5b. Answer export compliance if Info.plist didn't carry ITSAppUsesNonExemptEncryption
asc builds set-encryption-compliance --build-id $BUILD_ID --uses-non-exempt-encryption false
# 6. Link to version and submit
asc versions set-build --version-id $VERSION_ID --build-id $BUILD_ID
asc versions submit --version-id $VERSION_ID
CAEOAS 操作入口
上传响应中包含可直接运行的后续命令 affordances:
{
"data": [{
"affordances": {
"checkStatus": "asc builds uploads get --upload-id abc123",
"listBuilds": "asc builds list --app-id 123456789"
},
"state": "COMPLETE"
}]
}
仅当 state == "COMPLETE" 时才会显示 listBuilds。使用操作入口导航,无需记忆 ID。
参考
有关以下内容,请参阅 workflow.md:
- 完整的 5 步上传 API 流程细节
- 构建版本上传状态和轮询逻辑
- 错误场景和故障排查
评论
支持 Markdown