Fastlane 自动化打包

1、brew install fastlane
2、cd 到工程目录 fastlane init
     会生成三个文件
3、fastlane文件夹下操作:
     1、进入开发者、用户与访问、密钥,获取Issuer ID、密钥id,下载密钥p8文件、拷贝到fastlane文件夹、
     2、编辑Fastfile文件保存

# This file contains the fastlane.tools configuration

# You can find the documentation at https://docs.fastlane.tools

#

# For a list of all available actions, check out

#

#    https://docs.fastlane.tools/actions

#

# For a list of all available plugins, check out

#

#    https://docs.fastlane.tools/plugins/available-plugins

#

# Uncomment the line if you want fastlane to automatically update itself

# update_fastlane

default_platform(:ios)

platform :ios do

  desc "Description of what the lane does"

  lane :EcerMeeting do

  # add actions here: https://docs.fastlane.tools/actions

gym(

  # 每次打包之前clean一下

  clean: true,

  output_directory: './fastlane/release',

  output_name: 'EcerMeeting.ipa',

  scheme: "ChatMeet",

  configuration: 'Release',

  include_bitcode: false,

  include_symbols: true,

  # app-store, validation, ad-hoc, package, enterprise, development, developer-id and mac-application

  export_method: 'ad-hoc',

  export_xcargs: '-allowProvisioningUpdates'

)

  # mac上的通知弹窗,通知打包完毕

  notification(app_icon: './fastlane/icon.png', title: 'manager', subtitle: '打包成功,已导出安装包', message: '准备发布中……')

  # 配置上传到App Store connect的api_key

  # 通过这种设置可以绕过二次认证等验证操作,实现一键打包上传

#    api_key = app_store_connect_api_key(

#        # 通过苹果申请的key id,申请同时会生成issuer_id和一个授p8权文件,就是以下参数,文件只能下载一次,注意保存,申请方式https://appleid.apple.com/account/manage中的专用密钥

#    key_id: '527B932GS4',

#    issuer_id: '69a6de89-3863-47e3-e053-5b8c7c11a4d1',

#        # 授权文件路径

#    key_filepath: './fastlane/AuthKey_527B932GS4.p8',

#    duration: 1200,

#    in_house: false

#    )

#    # 上传到testflight

#    upload_to_testflight(

#        # 上边设置的授权信息

#    api_key: api_key,

#    skip_waiting_for_build_processing: true,

#        # 打包好要上传的文件

#    ipa: './fastlane/release/EcerMeeting.ipa',

#    skip_submission: true

#    )

#    # 通知上传成功

#    notification(app_icon:"icon.png",title:"LoanManager",subtitle: "IPA上传成功", message: "自动打包完成!")

  end

  end

4、终端操作、cd工程目录、fastlane xxx.   
     xxx为lane:字段

你可能感兴趣的:(Fastlane 自动化打包)