fastlane 安裝使用

brew install fastlane
安裝fastlane

進入iOS項目根目錄
fastlane init

fastfile文件

# fastlane/Fastfile
default_platform(:ios)



platform :ios do
  desc "打包并上傳到 App Store"
  lane :release do
    # 1. 更新版本號
    increment_version_number(
      version_number: "1.0.0"  # 設(shè)置版本號
    )
    
    # 2. 更新構(gòu)建號
    increment_build_number(
      build_number: "1"  # 設(shè)置構(gòu)建號
    )
    
    # 3. 獲取證書和描述文件
    # match(
    #   type: "appstore",
    #   readonly: true
    # )
    
    # 4. 構(gòu)建應(yīng)用
    build_app(
      scheme: "Runner",  # 替換為您的 scheme 名稱
      export_method: "app-store",
      export_options: {
        method: "app-store",
        provisioningProfiles: { 
          "com.bydauto.f-dealer" => "FDealer_AppStore"  # 替換為您的 Bundle ID 和描述文件名稱
        },
          signingStyle: "manual",  # 使用本地證書
        signingCertificate: "fd_dis.p12"  # 證書名稱
      }
    )
    
    # 5. 上傳到 App Store Connect
    upload_to_app_store(
      skip_screenshots: true,
      skip_metadata: true
    )
  end

  desc "打包測試版本"
  lane :beta do
    # 1. 更新構(gòu)建號
    increment_build_number(
      build_number: "1"
    )
    
    # 2. 獲取證書和描述文件
    # match(
    #   type: "adhoc",
    #   readonly: true
    # )
    
    # 3. 構(gòu)建應(yīng)用
    build_app(
      scheme: "Runner",
      export_method: "development",
      export_options: {
        method: "development",
        provisioningProfiles: { 
          "com.bydauto.f-dealer" => "FDealer_Develop" 
        },
    signingStyle: "manual",  # 使用本地證書
        signingCertificate: "fd.p12"  # 證書名稱
      }
    )
    
    # 4. 上傳到 TestFlight
    upload_to_testflight
  end
end

appfile文件

app_identifier "com.bydauto.f-dealer" # The bundle identifier of your app
apple_id "ipdappstore@byd.com" # Your Apple Developer Portal username
team_id "9YWJ3PZHZG"                      # 開發(fā)者團隊 ID
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容