Fastlane 脚本

Fastlane 脚本
一个工程多个项目(Target) 建立多个任务

default_platform(:ios)

    before_all do
      sh 'git pull'
      sh 'pod update XXXXX --no-repo-update'
    end


platform :ios do
  desc "打包..."
  ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "20"
 lane :XXXXXX do
  output_name="Target"
  version = get_version_number(#获取版本号
     xcodeproj: "XXXXXX.xcodeproj",
     target: "Target"
  )
  time = Time.new.strftime("%Y%m%d-%H:%m") #获取时间格式
  puts "开始打ad-hoc ipa"
  # 开始打包
  gym(
    scheme: "Target",
    #输出的ipa名称
    output_name:"#{output_name}_#{version}_#{time}",
    # 是否清空以前的编译信息 true:是
    clean:true,
    # 指定打包方式,Release 或者 Debug
    configuration:"Release",
    # 指定打包所使用的输出方式,目前支持app-store, package, ad-hoc, enterprise, development
    export_method:"ad-hoc",
    # 指定输出文件夹
    output_directory:"./fastlane/build",
  )
    #蒲公英api_key和user_key
    api_key=""
    user_key=""
     puts "开始上传蒲公英"
    pgyer(api_key: "#{api_key}", user_key: "#{user_key}")# 开始上传蒲公英
    puts "蒲公英上传成功 success..."
  end
  
  
  
   lane :XXXXX do
  end
end
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容