name: asc-签名设置 description: 使用 asc cli 设置 bundle ID、功能、签名证书和配置文件。在添加新应用或轮换签名资产时使用。
asc 签名设置
当您需要为 iOS/macOS 应用创建或更新签名资产时使用此技能。
前提条件
- 已配置认证(
asc auth login或ASC_*环境变量)。 - 您知道 bundle identifier 和目标平台。
- 您有用于证书创建的 CSR 文件。
工作流程
- 创建或查找 bundle ID:
asc bundle-ids list --paginateasc bundle-ids create --identifier "com.example.app" --name "Example" --platform IOS
- 配置 bundle ID 功能:
asc bundle-ids capabilities list --bundle "BUNDLE_ID"asc bundle-ids capabilities add --bundle "BUNDLE_ID" --capability ICLOUD- 需要时添加功能设置:
--settings '[{"key":"ICLOUD_VERSION","options":[{"key":"XCODE_13","enabled":true}]}]'
- 创建签名证书:
asc certificates list --certificate-type IOS_DISTRIBUTIONasc certificates create --certificate-type IOS_DISTRIBUTION --csr "./cert.csr"
- 创建配置文件:
asc profiles create --name "AppStore Profile" --profile-type IOS_APP_STORE --bundle "BUNDLE_ID" --certificate "CERT_ID"- 对于开发或临时设备包含:
asc profiles create --name "Dev Profile" --profile-type IOS_APP_DEVELOPMENT --bundle "BUNDLE_ID" --certificate "CERT_ID" --device "DEVICE_ID"
- 下载配置文件:
asc profiles download --id "PROFILE_ID" --output "./profiles/AppStore.mobileprovision"
轮换和清理
- 吊销旧证书:
asc certificates revoke --id "CERT_ID" --confirm
- 删除旧配置文件:
asc profiles delete --id "PROFILE_ID" --confirm
注意事项
- 始终检查
--help获取确切的枚举值(证书类型、配置文件类型)。 - 对于大账户使用
--paginate。 --certificate接受逗号分隔的 ID 当需要多个证书时。- 设备管理使用
asc devices命令(需要 UDID)。