日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

fastlane 自动化打包不同的target,以及手动传版本号参数

發布時間:2023/12/19 综合教程 24 生活家
生活随笔 收集整理的這篇文章主要介紹了 fastlane 自动化打包不同的target,以及手动传版本号参数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

fastlane安裝及自動化打包在之前的文檔中已經詳述——fastlane 安裝

一、這里是說明打包不同的target,例如兩個target,TestOne和TestTwo,ipa的大小分別是10M和20M。

主要是修改fastlane相關的Fastfile配置:兩個lane對應兩個target。

fasfile文件:

# 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
#

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

# 定義打包平臺
default_platform :ios

#指定項目的scheme名稱
output_name=“TestOne”
output_name_Two=“TestTwo”

platform :ios do
  desc "企業版"
  lane :TestOne do |op|

#根據輸入參version獲取app版本號

increment_version_number(version_number: op[:version])

  puts “開始打enterprise ipa”

  # 開始打包
  gym(
    scheme: "TestOne",
    #輸出的ipa名稱
    output_name:”#{output_name}”,
    # 是否清空以前的編譯信息 true:是
    clean:true,
    # 指定打包方式,Release 或者 Debug
    configuration:"Release",
    # 指定打包所使用的輸出方式,目前支持app-store, package, ad-hoc, enterprise, development
    export_method:"enterprise",
    # 指定輸出文件夾
    output_directory:"./fastlane/build",
  )
  end
    lane :TestTwo do

    puts “開始打enterprise ipa,SEMF標準版”

    # 開始打包
    gym(
    scheme: "TestTwo",
    #輸出的ipa名稱
    output_name:”#{output_name_Two}”,
    # 是否清空以前的編譯信息 true:是
    clean:true,
    # 指定打包方式,Release 或者 Debug
    configuration:"Release",
    # 指定打包所使用的輸出方式,目前支持app-store, package, ad-hoc, enterprise, development
    export_method:"enterprise",
    # 指定輸出文件夾
    output_directory:"./fastlane/build",
    )
    end

end

在終端輸入fastlane ios TestOne 打包的第一個target的ipa 大小10M

在終端輸入fastlane ios TestTwo 打包的第一個target的ipa 大小20M

這里有一個問題,就是在打包第二個target的時候有失敗,打包出來的還是第一個target只有10M的ipa或者直接失敗。

錯誤提示會出現

Couldn't find specified scheme 'TestTwo'.xxxxxx.

如下圖:

解決方法:

xcode打開項目,選中scheme,點擊Manage scheme,在相應的target后面點擊shared。如下圖所示:

勾選之后,點擊close。

在終端輸入命令:fastlane ios TestTwo 打包成功ipa大小20M。

二、版本號問題

lane : TestOne do |op|

#根據輸入入參version獲取app版本號

  increment_version_number(version_number: op[:version])

  具體如下圖:

  

  打包命令 eg:fastlane TestOne version:1.0.0

總結

以上是生活随笔為你收集整理的fastlane 自动化打包不同的target,以及手动传版本号参数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。