Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> iOS

Cách gia hạn (renew) Distribution Certificate cho iOS

Để gia hạn Distribution Certificate (chứng chỉ phân phối App Store) trên Mac, thực hiện theo các bước sau:

  1. Mở Keychain Access (Spotlight search "Keychain Access").
  2. Menu Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority.
  3. Điền thông tin: Email, Common Name (tên của bạn/doanh nghiệp), chọn Saved to disk.
  4. Chọn vị trí lưu, sẽ tạo file .certSigningRequest (CSR).
  5. Đăng nhập developer.apple.com > Certificates, Identifiers & Profiles.
  6. Chọn Certificates > Production > nút +.
  7. Chọn App Store and Ad Hoc (Production) > Continue.
  8. Upload file CSR vừa tạo > Generate.
  9. Tải certificate .cer về, double-click để cài vào Keychain.

Lưu ý quan trọng

  • Certificate Production (App Store) có hiệu lực 1 năm. Nên gia hạn trước khi hết hạn 1-2 tuần.
  • Sau khi gia hạn, cần tạo lại Provisioning Profile (Distribution) chứa certificate mới.
  • Xcode > Preferences > Accounts > Manage Certificates > Download Manual Profiles để cập nhật.
  • Nếu dùng Fastlane/CI, nhớ cập nhật certificate trong keychain của máy build.

Mẹo: Dùng fastlane match hoặc fastlane cert để tự động hóa quy trình này trong CI/CD.