今天看啥  ›  专栏  ›  zhao1zhihui

ios 打包研究(五)fastlane-gym(原shenzhen打包脚本)

zhao1zhihui  · 掘金  ·  · 2021-04-05 15:17

文章预览

阅读 2

ios 打包研究(五)fastlane-gym(原shenzhen打包脚本)

Gym为您构建和打包iOS应用。它可以处理所有繁重的工作,并且非常容易生成签名ipa或app文件💪

  • gym is a replacement for shenzhen.
  • Before gym
xcodebuild clean archive -archivePath build/MyApp \
                         -scheme MyApp
xcodebuild -exportArchive \
           -exportFormat ipa \
           -archivePath "build/MyApp.xcarchive" \
           -exportPath "build/MyApp.ipa" \
           -exportProvisioningProfile "ProvisioningProfileName"
复制代码
  • With gym
fastlane gym
复制代码
  • Gymfile

注:没有住在gtmfile文件而是在fastfile文件直接用的gym

lane :beta do
  scan
  gym(
  workspace: "MyApp.xcworkspace",
  configuration: "Debug",
  scheme: "MyApp",
  silent: true,
  clean: true,
  output_directory: "path/to/dir", # Destination directory. Defaults to current directory.
  output_name: "my-app.ipa",       # specify the name of the .ipa file to generate (including file extension)
  sdk: "iOS 11.1"        # use SDK as the name or path of the base SDK when building the project.
  export_options("./ExportOptions.plist")
  )
  crashlytics
end

# error block is executed when a error occurs
error do |lane, exception|
  slack(
    # message with short human friendly message
    message: exception.to_s, 
    success: false, 
    # Output containing extended log output
    payload: { "Output" => exception.error_info.to_s } 
  )
end
复制代码

注 gym 就是对xcodebuild的封装 支持xcodebuild的所有设置 如果不使用gym可以直接使用shenzhen

………………………………

原文地址:访问原文地址
快照地址: 访问文章快照
总结与预览地址:访问总结与预览