AdHoc和Appstore使用Fastlane匹配进行构建 [英] AdHoc and Appstore builds with Fastlane match

查看:145
本文介绍了AdHoc和Appstore使用Fastlane匹配进行构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够为 Firebase Distribution 构建 adhoc ,并为TestFlight/AppStore构建 appstore .我也在使用CI/CD系统( CircleCI ).我使用 Fastlane match 进行版本签名.我的问题是,当执行不同类型的构建时,如何在不同类型的证书之间进行切换?

I want to be able to do both adhoc builds for Firebase Distribution and appstore builds for TestFlight/AppStore. I'm also using CI/CD system (CircleCI). I use Fastlane match for builds signing. My question is how to do switch between different type of certificates when do different type of builds?

我的想法是在Xcode中设置调试配置临时签名证书和发布配置appstore证书.但是,当我测试这种方法时,发现应用程序启动后,即席构建立即崩溃,因此看来这种方法是不正确的.

My idea was to set up in Xcode for Debug configuration adhoc signing certificate, and for release configuration appstore certificate. However, when I tested this approach, turns out that adhoc builds are crashing immediately after the app launch, so it looks like this approach is not correct.

这是我的Fastfile:

Here is my Fastfile:

platform :ios do
  before_all do
    setup_circle_ci
  end

  desc "Runs tests and build the app "
  lane :testandbuild do |options|
     commit = last_git_commit
     # Uncomment the line if you want to increment build number  
     # increment_build_number(xcodeproj: "MyApp.xcodeproj")
     scan(
        scheme: "MyApp"
    )
    if(options[:branch] == "main")
      increment_build_number
      keyFilePath = File.join(Dir.pwd, "appStoreKey.p8")
      app_store_connect_api_key(
        key_id: options[:key_id],
        issuer_id: options[:issuer_id],
        key_filepath: keyFilePath,
        # duration: 1200,
        in_house: false,
      )
      match(type: "appstore", readonly: "false")
      build_app(
          scheme: "MyApp",
        configuration: "Release"
      )
      upload_to_testflight(
        skip_waiting_for_build_processing: true
      )
    else
       match(type: "adhoc")
       gym(export_method: "ad-hoc", scheme: "MyApp", configuration: "Debug" , output_directory: "../output")
       firebase_app_distribution(
               groups: 'dev-team',
               release_notes: "Branch: #{options[:branch]}. Message: #{commit[:message]}",
               firebase_cli_token: options[:firebase_cli_token]
       )
    end       
  end
end

推荐答案

我在健身房使用以下类似内容.

I use something like the following in my gym.

gym(
    workspace: xcodeworkspace,
    scheme: environment,
    configuration: environment,
    silent: true,
    clean: true,
    export_method: "ad-hoc",
    export_options: {
        provisioningProfiles: { 
            app_identifier => app_profile_name,
            balance_widget_identifier => balance_widget_profile_name
        }
    }
)

通过这种方式,我可以为今天的扩展"定义不同的配置文件(针对不同的版本).也是

This way I can define a different profile (for different builds) for the "today extension" as well.

这篇关于AdHoc和Appstore使用Fastlane匹配进行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆