asc-builds-archive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseasc Builds Archive & Export
asc 构建归档与导出
Archive Xcode projects, export IPA/PKG binaries, and optionally upload to App Store Connect — all in one command. See workflow.md for the full end-to-end flow.
一键完成Xcode项目归档、导出IPA/PKG二进制文件,还可选择上传至App Store Connect。完整端到端流程请查看workflow.md。
Commands
命令
Archive and export
归档并导出
bash
asc builds archive \
--scheme <SCHEME_NAME> \
[--workspace MyApp.xcworkspace] # auto-detected from cwd
[--project MyApp.xcodeproj] # auto-detected from cwd
[--platform ios|macos|tvos|visionos] # default: ios
[--configuration Release] # default: Release
[--export-method app-store-connect|ad-hoc|development|enterprise] # default: app-store-connect
[--signing-style automatic|manual] # default: automatic
[--team-id ABCD1234] # team ID for signing
[--output-dir .build] # default: .buildWorkspace/project are auto-detected from the current directory if not specified. The command runs followed by with an auto-generated ExportOptions plist.
xcodebuild archivexcodebuild -exportArchivebash
asc builds archive \
--scheme <SCHEME_NAME> \
[--workspace MyApp.xcworkspace] # 从当前目录自动检测
[--project MyApp.xcodeproj] # 从当前目录自动检测
[--platform ios|macos|tvos|visionos] # 默认值:ios
[--configuration Release] # 默认值:Release
[--export-method app-store-connect|ad-hoc|development|enterprise] # 默认值:app-store-connect
[--signing-style automatic|manual] # 默认值:automatic
[--team-id ABCD1234] # 签名用的团队ID
[--output-dir .build] # 默认值:.build若未指定工作区/项目,将从当前目录自动检测。该命令会先执行,再结合自动生成的ExportOptions plist执行。
xcodebuild archivexcodebuild -exportArchiveArchive + export + upload (one command)
一步完成归档+导出+上传
bash
asc builds archive \
--scheme <SCHEME_NAME> \
--upload \
--app-id <APP_ID> \
--version 1.0.0 \
--build-number 42The flag chains the exported IPA/PKG directly into the existing flow.
--uploadasc builds uploadbash
asc builds archive \
--scheme <SCHEME_NAME> \
--upload \
--app-id <APP_ID> \
--version 1.0.0 \
--build-number 42--uploadasc builds uploadResolve App ID
解析App ID
See project-context.md — check before asking the user or running .
.asc/project.jsonasc apps list请查看project-context.md — 在询问用户或执行前,先检查文件。
asc apps list.asc/project.jsonTypical Workflow
典型工作流
bash
APP_ID=$(cat .asc/project.json 2>/dev/null | jq -r '.appId // empty')bash
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'
asc apps list | jq -r '.data[0].id'若为空:询问用户或执行asc apps list | jq -r '.data[0].id'
asc apps list | jq -r '.data[0].id'1. Archive, export, and upload in one command
1. 一键完成归档、导出与上传
asc builds archive --scheme MyApp --upload
--app-id "$APP_ID" --version 1.2.0 --build-number 55
--app-id "$APP_ID" --version 1.2.0 --build-number 55
asc builds archive --scheme MyApp --upload
--app-id "$APP_ID" --version 1.2.0 --build-number 55
--app-id "$APP_ID" --version 1.2.0 --build-number 55
2. Get the processed build ID
2. 获取已处理的构建ID
BUILD_ID=$(asc builds list --app-id $APP_ID | jq -r '.data[0].id')
BUILD_ID=$(asc builds list --app-id $APP_ID | jq -r '.data[0].id')
3. Distribute to TestFlight beta group
3. 分发至TestFlight测试组
asc builds add-beta-group --build-id $BUILD_ID --beta-group-id $GROUP_ID
asc builds add-beta-group --build-id $BUILD_ID --beta-group-id $GROUP_ID
4. Set TestFlight notes
4. 设置TestFlight测试说明
asc builds update-beta-notes --build-id $BUILD_ID --locale en-US --notes "New features"
asc builds update-beta-notes --build-id $BUILD_ID --locale en-US --notes "新功能"
5. Link to version and submit for review
5. 关联版本并提交审核
asc versions set-build --version-id $VERSION_ID --build-id $BUILD_ID
asc versions submit --version-id $VERSION_ID
undefinedasc versions set-build --version-id $VERSION_ID --build-id $BUILD_ID
asc versions submit --version-id $VERSION_ID
undefinedArchive only (no upload)
仅归档(不上传)
bash
undefinedbash
undefinedArchive and export to default .build/export/
归档并导出至默认目录.build/export/
asc builds archive --scheme MyApp
asc builds archive --scheme MyApp
The output includes an affordance for the next step:
输出内容包含下一步操作提示:
"upload": "asc builds upload --file .build/export/MyApp.ipa"
"upload": "asc builds upload --file .build/export/MyApp.ipa"
Ad-hoc distribution
临时分发(Ad-hoc)
asc builds archive --scheme MyApp --export-method ad-hoc --output-dir dist/
asc builds archive --scheme MyApp --export-method ad-hoc --output-dir dist/
Manual signing with team ID
手动签名并指定团队ID
asc builds archive --scheme MyApp --signing-style manual --team-id ABCD1234
asc builds archive --scheme MyApp --signing-style manual --team-id ABCD1234
macOS app
macOS应用
asc builds archive --scheme MyMacApp --platform macos
undefinedasc builds archive --scheme MyMacApp --platform macos
undefinedExport Methods
导出方式
| Method | Use case |
|---|---|
| App Store / TestFlight distribution (default) |
| Direct distribution to registered devices |
| Development testing on registered devices |
| In-house enterprise distribution |
| 方式 | 使用场景 |
|---|---|
| App Store / TestFlight分发(默认) |
| 直接分发给已注册设备 |
| 已注册设备上的开发测试 |
| 企业内部分发 |
Signing Options
签名选项
| Flag | Default | Description |
|---|---|---|
| | |
| (none) | Apple Developer team ID; useful when multiple teams are configured |
When (the default), the export step passes to so profiles are automatically resolved.
--signing-style automatic-allowProvisioningUpdatesxcodebuild| 参数 | 默认值 | 说明 |
|---|---|---|
| | |
| (无) | Apple开发者团队ID;当配置了多个团队时非常有用 |
当使用默认的时,导出步骤会向传递参数,自动解析配置文件。
--signing-style automaticxcodebuild-allowProvisioningUpdatesCAEOAS Affordances
CAEOAS 操作提示
Archive-only responses include an affordance pointing to the exported binary:
uploadjson
{
"data": [{
"ipaPath": ".build/export/MyApp.ipa",
"exportPath": ".build/export",
"affordances": {
"upload": "asc builds upload --file .build/export/MyApp.ipa"
}
}]
}When is used, the response matches the standard build upload format with and affordances.
--uploadcheckStatuslistBuilds仅归档的响应会包含指向导出二进制文件的操作提示:
uploadjson
{
"data": [{
"ipaPath": ".build/export/MyApp.ipa",
"exportPath": ".build/export",
"affordances": {
"upload": "asc builds upload --file .build/export/MyApp.ipa"
}
}]
}当使用参数时,响应会匹配标准的构建上传格式,包含和操作提示。
--uploadcheckStatuslistBuildsTroubleshooting
故障排查
| Error | Cause | Fix |
|---|---|---|
| "Unknown platform: watchos" | Invalid platform argument | Use: |
| "Scheme not found" | Scheme doesn't exist or workspace not detected | Pass |
| "no signing identity found" | Code signing not configured | Configure signing in Xcode or pass |
| "No profiles for 'X' were found" | Provisioning profile not available | Default |
| "app-store" is deprecated | Old export method name | Use |
| "No .ipa or .pkg found" | Export succeeded but no binary produced | Check xcodebuild output, verify scheme builds an app target |
| "--app-id is required" | | Provide |
| 错误 | 原因 | 解决方法 |
|---|---|---|
| "Unknown platform: watchos" | 无效的平台参数 | 使用: |
| "Scheme not found" | Scheme不存在或未检测到工作区 | 显式传递 |
| "no signing identity found" | 未配置代码签名 | 在Xcode中配置签名,或传递 |
| "No profiles for 'X' were found" | 找不到配置文件 | 默认的 |
| "app-store" is deprecated | 旧的导出方式名称 | 使用 |
| "No .ipa or .pkg found" | 导出成功但未生成二进制文件 | 查看xcodebuild输出,验证Scheme是否构建应用目标 |
| "--app-id is required" | 使用 | 提供 |
Reference
参考文档
See workflow.md for:
- Auto-detection logic for workspace/project
- ExportOptions plist generation details
- Platform-to-destination mapping
- How archive chains into the upload flow
请查看workflow.md了解:
- 工作区/项目的自动检测逻辑
- ExportOptions plist的生成细节
- 平台与目标的映射关系
- 归档流程如何衔接至上传流程