Skip to content

morrischen/Xcode-Multiple-Env-With-Bitrise-CICD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 

Repository files navigation

Xcode多環境與Bitrise自動部署設定

1. 建立Xcode環境設定檔

  • 建立Development xcconfig
  • Development設定檔
  • 建立Production xcconfig
  • Production設定檔

2. 設定Xcode Project Configurations

  • 建立Debug Configuration,並選擇環境設定檔為Development xcconfig
  • 建立Stage Configuration,並選擇環境設定檔為Stage xcconfig
  • 建立Release Configuration,並選擇環境設定檔為Production xcconfig
  • Project Configurations

3. 建立Xcode Build Schemes

  • 建立Development Scheme
  • New Development Scheme
  • New Development Scheme
  • 設定Development Scheme
  • Edit Development Scheme
  • Edit Development Scheme

4. 設定Xcode Signing

  • 設定Signing為Automatically Manage Signing
  • Xcode Signing

5. 設定Bitrise綁定Apple Service Connection

Caution

App Store Connect API金鑰的存取權限,必須為管理者權限

  • 設定Bitrise API KeyApp Store Connect
  • Bitrise API Key
  • Bitrise App Store Connect

6. 設定Bitrise Code Signing

Note

建議同時上傳DevelopmentDistributionCertificate,這樣Bitrise就不會產生新的Certificate

Caution

因為使用Bitrise Automatic code signing,無須上傳Provisioning Profile檔案

  • Bitrise Certificate

7. 設定Workflows

  • 建立deployDevelopmentWorkflow,參考網站
  • 刪除Certificate and profile installer步驟
  • DeployDevelopment Workflow
  • 設定Xcode Archive & Export for iOSConfiguration
    • Scheme: 設定為第三步驟建立的Scheme,例如: xxx-iOS-Development
    • Distribution method: 設定為app-store
  • 設定Xcodebuild Configuration
    • Build Configuration: 設定為第二步驟建立的Configuration,例如: Debug
  • DeployDevelopment Workflow Xcodebuild Configuration
  • 設定Automatic Code Signing
    • Automatic code signing method: 設定為api-key方式
  • DeployDevelopment Workflow Automatic Code Signing
  • deployProduction Workflow 設置大致相同
  • DeployProduction Workflow

8. 設定Triggers

  • Tag規則如下
    • V-*: 代表V-開頭的tag會觸發deployProduction workflow
    • Stage-*: 代表Stage-開頭的tag會觸發deployStage workflow
    • Dev-*: 代表Dev-開頭的tag會觸發deployDevelopment workflow
  • Triggers rule

9. 測試不同環境部署

  • 測試部署到DevelopmentStageProduction這三個環境,並將應用程式上傳到 App Store Connect。
  • Development Stage Build
  • Production Build
  • Xcode Archive & Export for iOS步驟的日誌中顯示,Bitrise 透過 API 金鑰的方式下載憑證檔案。
  • Using Apple Service connection with API key
  • Downloading certificates

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published