asc-code-signing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Signing with asc
asc使用asc
进行代码签名
ascManage 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.p8CAEOAS — Affordances Guide Next Steps
CAEOAS — 可用操作指南后续步骤
Every JSON response includes with ready-to-run commands:
"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"
}
}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
undefinedbash
undefined1. Register bundle identifier
1. 注册Bundle标识符
asc bundle-ids create
--name "My App"
--identifier "com.example.myapp"
--platform ios
--name "My App"
--identifier "com.example.myapp"
--platform ios
asc bundle-ids create
--name "My App"
--identifier "com.example.myapp"
--platform ios
--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)"
--type IOS_DISTRIBUTION
--csr-content "$(cat MyApp.certSigningRequest)"
asc certificates create
--type IOS_DISTRIBUTION
--csr-content "$(cat MyApp.certSigningRequest)"
--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>
--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>
--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
undefinedasc profiles list --bundle-id-id <bid-id> --pretty
undefinedKey Types
关键类型
Profile types: · · · · ·
IOS_APP_STOREIOS_APP_DEVELOPMENTIOS_APP_ADHOCMAC_APP_STOREMAC_APP_DEVELOPMENTMAC_APP_DIRECTCertificate types: · · · ·
IOS_DISTRIBUTIONIOS_DEVELOPMENTMAC_APP_DISTRIBUTIONMAC_APP_DEVELOPMENTDEVELOPER_ID_APPLICATIONPlatforms (CLI argument): · ·
iosmacosuniversal配置描述文件类型: · · · · ·
IOS_APP_STOREIOS_APP_DEVELOPMENTIOS_APP_ADHOCMAC_APP_STOREMAC_APP_DEVELOPMENTMAC_APP_DIRECT证书类型: · · · ·
IOS_DISTRIBUTIONIOS_DEVELOPMENTMAC_APP_DISTRIBUTIONMAC_APP_DEVELOPMENTDEVELOPER_ID_APPLICATION平台(CLI参数): · ·
iosmacosuniversalOutput Flags
输出标记
bash
--pretty # Pretty-print JSON
--output table # Table format
--output markdown # Markdown tablebash
--pretty # 格式化打印JSON
--output table # 表格格式
--output markdown # Markdown表格格式Full Command Reference
完整命令参考
See commands.md for all flags, filters, and examples for each command.
查看commands.md获取所有命令的标记、筛选器及示例。