is it possible to make fastlane match to choose apple distribution certificate type by default
Asked Answered
W

2

6

Apple have different certificate type, now when I am build my project, the fastlane chooose iOS distribution certificate by default. Shows error:

error: No signing certificate "iOS Distribution" found: No "iOS Distribution" signing certificate matching team ID "***" with a private key was found. (in target 'Runner' from project 'Runner')

and I check my local machine certificate and found the certificate was the newest Apple Distribution certificate.

  • Why the fastlane choose iOS distribution?
  • Is it possible to make it choose Apple Distribution by defualt?
  • How the fastlane choose certificate?

this is my local machine certificate(now I am reuse the certificate to sign app):

enter image description here

this is my fastlane match config:

default_platform(:ios)

platform :ios do
  desc "Description of what the lane does"
  lane :beta do
    xcode_select "/Applications/Xcode_12.4.app"

    create_keychain(
        name: ENV['MATCH_KEYCHAIN_NAME'],
        password: ENV["MATCH_KEYCHAIN_PASSWORD"],
        default_keychain: true,
        unlock: true,
        timeout: 3600,
        lock_when_sleeps: false
    )

    match(
          app_identifier: ENV["APP_IDENTIFIER"],
          git_url: ENV["GIT_URL"],
          type: "adhoc",
          readonly: is_ci,
          keychain_name: ENV['MATCH_KEYCHAIN_NAME'],
          keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"]
    )

    build_app(
        workspace: "Runner.xcworkspace",
        scheme: "Runner",
        export_method: "ad-hoc"
    )

    pgyer(
        api_key: ENV['PGY_API_KEY'],
        user_key: ENV['PGY_USER_KEY']
    )
    # add actions here: https://docs.fastlane.tools/actions
  end
end
Wilbanks answered 19/8, 2021 at 2:5 Comment(1)
No,I did not found the solution.Wilbanks
S
1

This should fix the problem: (provide some info for fastlane in export_options section.

build_app(
    scheme:"prod",
    export_method:"app-store",
    skip_profile_detection:true,
    configuration: "Release-prod",
    workspace: "Runner.xcworkspace",
    export_options: {
        provisioningProfiles: {
            APP_ID => PROVISIONING_PROFILE_APPSTORE,
            WIDGET_APP_ID => WIDGET_PROVISIONING_PROFILE
        },
        installerSigningCertificate: "Apple Distribution: company name (id)"
    }
)
Spittle answered 25/2, 2024 at 7:51 Comment(0)
S
0

fastlane match has an option generate_apple_certs. The default value is true which will generate the 'Apple Distribution Certificate'. Setting it to false will result in an 'iOS Distribution Certificate'.

Scrawly answered 21/11, 2022 at 10:34 Comment(1)
I don't know why this answer got downvote. This is the actual answer to the OP question.Kauppi

© 2022 - 2025 — McMap. All rights reserved.