FastLane+タンポポ実行スクリプト自動パッケージング

5339 ワード

変な質問をしたらgemを使って関連するツールをアンインストールし、どんな環境のパッケージを打ってもdistributionのプロファイルを使うと報告しました.とても分かりにくいので、アンインストールして再インストールすれば大丈夫です.

0、削除

gem list #       
gem uninstall #       

1、xcodeコマンドラインツールのインストール

xcode-select --install

インストールされていない場合は、ダイアログボックスがポップアップされ、インストールをクリックします.xcode-select:error:command line tools are already installedとプロンプトが表示された場合、use「Software Update」to install updatesはインストール済みであることを示します.

2、Fastlaneのインストール

sudo gem install fastlane -NV#        ,             

3、検査バージョン

fastlane --version #fastlane 2.102.0

4、タンポポに梱包


タンポポ関連構成タンポポドキュメントの表示
sudo fastlane add_plugin pgyer

5、Fastlaneを初期化する


cdはあなたのプロジェクトディレクトリに実行します
fastlane init 

6、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 "Push a new release build to the App Store"
  #lane :release do
    #build_app(workspace: "HBCGAPP.xcworkspace", scheme: "HBCGAPP")
    #upload_to_app_store
  #end
#end


#fastlane_version "2.57.2"

default_platform :ios

platform :ios do
  before_all do
    # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
    
  end

 #     
 lane :Dev do
    gym(
    scheme: "HBCGAPP", # Build your app - more options available
    clean:true, #      clean
    configuration: "Debug",  #    Release  
    export_method:"development",
    output_directory: "/Users/anxianglong/Desktop/   ",
    export_xcargs: "-allowProvisioningUpdates"
    ) 
    #pgyer(api_key: "xxxxxxxx", user_key: "xxxxxx", update_description: "    ")
    firim(firim_api_token:"b071288f8edec1bd9fa8226baa02188d")
  end

 #     
 lane :Ent do
    gym(
    scheme: "HBCGAPP", 
    clean:true, 
    configuration: "Release", 
    export_method:"enterprise",
    output_directory: "/Users/anxianglong/Desktop/   ",
    export_xcargs: "-allowProvisioningUpdates"
    ) 
    #pgyer(api_key: "xxxx", user_key: "xxxx", update_description: "    ")
   firim(firim_api_token:"b071288f8edec1bd9fa8226baa02188d")
  end

 #         
 lane :Adh do
    gym(
    scheme: "xxxx", 
    clean:true, #      clean
    configuration: "Release",  #    Release  
    export_method:"ad-hoc",
    output_directory: "/Users/xxxxxx/Desktop/IPA",
    export_xcargs: "-allowProvisioningUpdates"
    ) 
    pgyer(api_key: "xxxx", user_key: "xxxxx", update_description: "    ")
    #firim(firim_api_token:"xxxx")
  end

  #     AppStore  
  lane :App do
    gym(
    scheme: "xxxx", # Build your app - more options available
    clean:true, #      clean
    configuration: "Release",  #    Release  
    export_method:"app-store",
    output_directory: "/Users/xxxx/Desktop/IPA",
    export_xcargs: "-allowProvisioningUpdates"
    )
  deliver(force: true)
  end

  # You can define as many lanes as you want

  after_all do |lane|
    # This block is called, only if the executed lane was successful

    # slack(
    #   message: "Successfully deployed new App Update."
    # )
  end

  error do |lane, exception|
    # slack(
    #   message: exception.message,
    #   success: false
    # )
  end
end

7、梱包

fastlane Dev

8、マルチパラメータ

fastlane Dev appversion:100 buildNumber:111

fastlaneファイル
 #      
 lane :Dev do |options| 

    # build:options[:build]
    # increment_build_number

    # get_info_plist_value
  
  set_info_plist_value(path: "HBCGAPP/Info.plist", key: "CFBundleShortVersionString", value: options[:appversion])
  set_info_plist_value(path: "HBCGAPP/Info.plist", key: "CFBundleVersion", value: options[:buildNumber])
  

    gym(
    scheme: "HBCGAPP", # Build your app - more options available
    workspace: "HBCGAPP.xcworkspace",
    clean:true, #      clean
    xcargs: 'DEBUG_INFORMATION_FORMAT="dwarf-with-dsym"',
    configuration: "Debug",  #    Release  
    export_method:"development",
    output_directory: "~/Desktop/  ",
    export_xcargs: "-allowProvisioningUpdates",
      include_symbols:true,
      output_name: 'HBCGAPP' + ' ' + Time.now.strftime('%Y-%m-%d %H:%M')
    )

    #pgyer(api_key: "xxxxxxxx", user_key: "xxxxxx", update_description: "    ")
    pgyer(api_key: "***", user_key: "***", update_description: "    ")
  end