asc-code-signing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Signing with
asc

使用
asc
进行代码签名

Manage the full Apple code signing chain: bundle IDs → certificates → devices → profiles.
管理完整的Apple代码签名链:Bundle ID → 证书 → 设备 → 配置描述文件。

Authentication

身份验证

Set up credentials before any code signing commands:
bash
asc auth login --key-id <id> --issuer-id <id> --private-key-path ~/.asc/AuthKey.p8
在执行任何代码签名命令前设置凭据:
bash
asc auth login --key-id <id> --issuer-id <id> --private-key-path ~/.asc/AuthKey.p8

CAEOAS — Affordances Guide Next Steps

CAEOAS — 可用操作指南后续步骤

Every JSON response includes
"affordances"
with ready-to-run commands:
json
{
  "id": "bid-1",
  "identifier": "com.example.app",
  "affordances": {
    "listProfiles": "asc profiles list --bundle-id-id bid-1",
    "delete": "asc bundle-ids delete --bundle-id-id bid-1"
  }
}
Copy affordance commands directly — no need to look up IDs.
每个JSON响应都包含带有可直接运行命令的
"affordances"
字段:
json
{
  "id": "bid-1",
  "identifier": "com.example.app",
  "affordances": {
    "listProfiles": "asc profiles list --bundle-id-id bid-1",
    "delete": "asc bundle-ids delete --bundle-id-id bid-1"
  }
}
直接复制可用操作命令即可——无需手动查找ID。

Typical CI/CD Signing Setup

典型CI/CD签名设置

bash
undefined
bash
undefined

1. Register bundle identifier

1. 注册Bundle标识符

asc bundle-ids create
--name "My App"
--identifier "com.example.myapp"
--platform ios
asc bundle-ids create
--name "My App"
--identifier "com.example.myapp"
--platform ios

2. Create distribution certificate from a CSR

2. 从CSR创建分发证书

asc certificates create
--type IOS_DISTRIBUTION
--csr-content "$(cat MyApp.certSigningRequest)"
asc certificates create
--type IOS_DISTRIBUTION
--csr-content "$(cat MyApp.certSigningRequest)"

3. Register test devices (development profiles only)

3. 注册测试设备(仅适用于开发配置描述文件)

asc devices register --name "My iPhone" --udid "<udid>" --platform ios
asc devices register --name "My iPhone" --udid "<udid>" --platform ios

4. Grab resource IDs

4. 获取资源ID

asc bundle-ids list --identifier com.example.myapp # note the id asc certificates list --type IOS_DISTRIBUTION # note the id
asc bundle-ids list --identifier com.example.myapp # 记录ID asc certificates list --type IOS_DISTRIBUTION # 记录ID

5. Create provisioning profile

5. 创建配置描述文件

asc profiles create
--name "My App Store Profile"
--type IOS_APP_STORE
--bundle-id-id <bid-id>
--certificate-ids <cert-id>
asc profiles create
--name "My App Store Profile"
--type IOS_APP_STORE
--bundle-id-id <bid-id>
--certificate-ids <cert-id>

6. Verify

6. 验证

asc profiles list --bundle-id-id <bid-id> --pretty
undefined
asc profiles list --bundle-id-id <bid-id> --pretty
undefined

Key Types

关键类型

Profile types:
IOS_APP_STORE
·
IOS_APP_DEVELOPMENT
·
IOS_APP_ADHOC
·
MAC_APP_STORE
·
MAC_APP_DEVELOPMENT
·
MAC_APP_DIRECT
Certificate types:
IOS_DISTRIBUTION
·
IOS_DEVELOPMENT
·
MAC_APP_DISTRIBUTION
·
MAC_APP_DEVELOPMENT
·
DEVELOPER_ID_APPLICATION
Platforms (CLI argument):
ios
·
macos
·
universal
配置描述文件类型:
IOS_APP_STORE
·
IOS_APP_DEVELOPMENT
·
IOS_APP_ADHOC
·
MAC_APP_STORE
·
MAC_APP_DEVELOPMENT
·
MAC_APP_DIRECT
证书类型:
IOS_DISTRIBUTION
·
IOS_DEVELOPMENT
·
MAC_APP_DISTRIBUTION
·
MAC_APP_DEVELOPMENT
·
DEVELOPER_ID_APPLICATION
平台(CLI参数):
ios
·
macos
·
universal

Output Flags

输出标记

bash
--pretty          # Pretty-print JSON
--output table    # Table format
--output markdown # Markdown table
bash
--pretty          # 格式化打印JSON
--output table    # 表格格式
--output markdown # Markdown表格格式

Full Command Reference

完整命令参考

See commands.md for all flags, filters, and examples for each command.
查看commands.md获取所有命令的标记、筛选器及示例。