这个项目能做什么
App Store Connect CLI(`asc`)是一个快速、可脚本化的命令行工具,用于自动化 iOS、macOS、tvOS 和 visionOS 平台上的 App Store Connect 工作流。
### 安装
- Homebrew:`brew install asc`
- 安装脚本:`curl -fsSL https://asccli.sh/install | bash`
- WinGet:`winget install Rorkai.ASC --exact`
- 发布二进制文件可从 GitHub releases 获取;源码构建需要 go.mod 中声明的 Go 版本。
### 认证
API 密钥在 appstoreconnect.apple.com 生成。使用以下命令认证:
```bash
asc auth login --name "MyApp" --key-id "ABC123" --issuer-id "DEF456" --private-key /path/to/AuthKey.p8 --network
```
个人 API 密钥省略 `--issuer-id` 并使用 `--key-type individual`。对于 CI 或无头环境,传入 `--bypass-keychain`。使用 `asc auth status --validate` 或 `asc auth doctor` 进行验证。
### 输出默认值
`asc` 在交互式终端中使用 `table` 输出,在管道/CI 中使用 `json`。可通过 `ASC_DEFAULT_OUTPUT` 全局覆盖,或使用 `--output json --pretty` 按命令覆盖。
### 常见工作流
**TestFlight 和构建:**
```bash
asc apps list --output table
asc builds upload --app "APP_ID" --ipa "/path/to/MyApp.ipa"
asc testflight groups list --app "APP_ID"
```
**App Store 提交:**
```bash
asc publish appstore --app "APP_ID" --ipa "/path/to/MyApp.ipa" --version "1.2.3" --submit --confirm
asc status --app "APP_ID" --watch
```
**验证和审核:**
```bash
asc validate --app "APP_ID" --version "1.2.3"
asc review status --app "APP_ID"
asc validate --app "APP_ID" --version "1.2.3" --deep
```
深度验证通过 Apple 的已登录 Web 端点检查 App 隐私、协议和订阅附件,无需交互式提示。
**元数据和本地化:**
```bash
asc localizations list --app "APP_ID" --type app-info
asc metadata apply --app "APP_ID" --version "1.2.3" --dir "./metadata" --dry-run
asc metadata keywords audit --app "APP_ID" --version "1.2.3" --blocked-terms-file "./blocked-terms.txt"
```
关键词审计会报告重复项、与 App 名称/副标题的重叠、字节预算使用情况以及被屏蔽的术语。
**截图和媒体:**
```bash
asc screenshots plan --app "APP_ID" --version "1.2.3" --review-output-dir "./screenshots/review"
asc screenshots apply --app "APP_ID" --version "1.2.3" --review-output-dir "./screenshots/review" --confirm
```
通过 JSONC 计划文件支持跨设备、语言区域和外观的基于矩阵的截图捕获。
**签名和 Bundle ID:**
```bash
asc bundle-ids capabilities list --bundle "BUNDLE_ID"
asc signing fetch --bundle-id com.example.app --profile-type IOS_APP_STORE --output .asc/signing
asc signing sync pull --repo [email protected]:team/signing.git --password-file ~/.config/asc/signing-sync-password --output-dir .asc/signing/pulled
```
`signing fetch` 下载证书和配置文件。`signing sync` 通过加密的 Git 存储共享身份。使用 `--create-missing` 一次性生成缺失的密钥/证书/配置文件。
**工作流自动化:**
```bash
asc workflow validate --output json
asc workflow run --dry-run testflight_beta VERSION:1.2.3
```
**Xcode Cloud:**
```bash
asc xcode-cloud run --workflow-id "WORKFLOW_ID" --pull-request-id "PR_ID"
asc xcode-cloud build-runs get --id "BUILD_RUN_ID"
```
**Apple Ads 和 StoreKit:**
Apple Ads 广告系列和 StoreKit Retention Messaging 使用单独的 OAuth 凭据。有关设置,请参阅 `asc ads auth login` 和 `asc storekit auth login`。
### Agent Skills
25 个经过审核的 `asc` 自动化技能可在 https://github.com/rorkai/app-store-connect-cli-skills 获取。使用 `asc install-skills` 全局安装,它会固定已检出的提交并验证每个文件。
### 隐私和遥测
默认发送匿名的命令级遥测,以帮助维护者跟踪可靠性。事件包括 CLI 版本、操作系统、架构、命令路径、持续时间以及失败时的 HTTP 状态。它们不包括原始参数、凭据、Apple 账户标识符、Bundle ID 和文件路径。可通过 `ASC_TELEMETRY_DISABLED=1`、`DO_NOT_TRACK=1` 或 `asc telemetry disable` 禁用。
### 文档
- `docs/CI_CD.md` — GitHub Actions、GitLab、Bitrise、CircleCI 集成
- `docs/WORKFLOWS.md` — 本地 Xcode 到 TestFlight 模式
- `commands/signing.mdx` — 签名身份设置和 CI 轮换
- `guides/apple-ads-playbooks.mdx` — Apple Ads 操作员指南
- `docs/API_NOTES.md` — API 特殊行为和特性
- `docs/PARITY.md` — 剩余对等区域
内置帮助是权威来源:`asc <command> --help`。
许可证:MIT。非官方工具,与 Apple Inc. 无关联。
评论
0 人表达喜爱 · 满10人后显示 Deer Point
登录后参与讨论。