ios - Jenkins/faSTLane - 没有找到本地代码签名身份

标签 ios jenkins fastlane fastlane-match

我在使用 Jenkins 时遇到 faSTLane 问题。

Runing this command in terminal works fastlane provide_crashlytics_build testing:false check_xcode:false --env xxx, but from Jenkins not working



错误信息:
There are no local code signing identities found.
You can run `security find-identity -v -p codesigning` to get this output.
This Stack Overflow thread has more information: https://stackoverflow.com/q/35390072/774.
(Check in Keychain Access for an expired WWDR certificate: https://stackoverflow.com/a/35409835/774 has more info.)
[14:03:30]: No certificates for filter: Certificate ID: '7D72F7MC75' 
[14:03:30]: something bad happened: Could not find a matching code signing identity for type 'AdHoc'.

快速 channel 版本 2.141.0

追踪步骤:
  • 我运行这个命令 security find-identity -v -p codesigning结果如下:2 valid identities found
  • 我检查了 Apple Worldwide Developer 证书及其有效且受信任的证书
  • 我检查了 Keychain 和 Apple Developer 帐户中的分发证书,两者都在那里

  • 这是 Jenkins 执行 shell :
    #!/bin/zsh
    export TERM=xterm-256color
    export LANG=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    
    export GIT_TRACE_PACKET=1
    export GIT_CURL_VERBOSE=1
    
    source /Users/Shared/Jenkins/.rvm/scripts/rvm
    rvm use 2.6.3
    
    fastlane provide_crashlytics_build testing:false check_xcode:false --env xxx
    

    这是faslane车道:
    ########## Upload testbuild to crashlytics ##########
      desc "Upload testbuild to crashlytics"
      lane :provide_crashlytics_build do |options|
    
        if options[:check_xcode]
          verify_xcode
        end
    
        if options[:add_badge]
            if ENV['DARK_BADGE']
            badge(dark: true)
            else
            badge
            end
        end
    
        build_preparations
    
        if options[:testing]
          start_tests
        end
    
        pem
    
        match(
          type: "adhoc",
          app_identifier: [ENV['APP_IDENTIFIER'], ENV['APP_NOTIFICATION_EXTENSION_IDENTIFIER']],
          force_for_new_devices: true
        )
    
        gym(
          xcargs: "ARCHIVE=NO",
          output_name: "#{ENV['OUTPUT_NAME_TESTING']}"
        )
    
        verify_build(
          provisioning_type: 'distribution',
          bundle_identifier: ENV['APP_IDENTIFIER']
        )
    
        version = get_ipa_info_plist_value(ipa: "#{ENV['OUTPUT_NAME_TESTING']}.ipa", key: "CFBundleShortVersionString")
    
        crashlytics(
          api_token: ENV['CRASHLYTICS_API_TOKEN'],
          build_secret: ENV['CRASHLYTICS_BUILD_SECRET'],
          emails: ENV['CRASHLYTICS_EMAILS'],
          notifications: false,
          notes: "#{change_log_last_five_commits}"
        )
    
        if ENV['SLACK_URL']
          sh ("say 'Yippee! What a awsome day. Thanks to #{lastCommitAuthor} something great happend. A new build is born.'")  
    
          slack(
            message: "New crashlytics build of #{ENV['SCHEME']} v.#{version}(#{build})",
            channel: "#{ENV['SLACK_CHANNEL']}",
            success: true,
            use_webhook_configured_username_and_icon: true,
            default_payloads: [],
            payload: {
              'Release Notes' => change_log_last_five_commits
            }
          )
        end
    
        clean_build_artifacts
      end
    

    以下是 faSTLane 日志:
    Summary for match 2.141.0                                              |
    +----------------------------+---------------------------------------------------------------------------------------+
    | type                       | adhoc                                                                                 |
    | app_identifier             | ["xxxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxx.NotificationServiceExtension"] |
    | force_for_new_devices      | true                                                                                  |
    | readonly                   | false                                                                                 |
    | generate_apple_certs       | false                                                                                 |
    | skip_provisioning_profiles | false                                                                                 |
    | username                   | xxxxxxxxxxxxxxx                                                                       |
    | team_id                    | R2Q6VXW97P                                                                            |
    | team_name                  | xxxxxxxxxxxxxxxxxxxxxxxxx                                                             |
    | storage_mode               | git                                                                                   |
    | git_url                    | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                       |
    | git_branch                 | master                                                                                |
    | shallow_clone              | false                                                                                 |
    | clone_branch_directly      | false                                                                                 |
    | keychain_name              | login.keychain                                                                        |
    | force                      | false                                                                                 |
    | skip_confirmation          | false                                                                                 |
    | skip_docs                  | false                                                                                 |
    | platform                   | ios                                                                                   |
    | verbose                    | false                                                                                 |
    +----------------------------+---------------------------------------------------------------------------------------+
    
    +-------------------+-------------------------------------------------------------+
    |                              Installed Certificate                              |
    +-------------------+-------------------------------------------------------------+
    | User ID           | R2Q6VXW97P                                                  |
    | Common Name       | iPhone Distribution: xxxxxxxxxxxxxxxxxxxxxxxxx (R2Q6VXW97P) |
    | Organisation Unit | R2Q6VXW97P                                                  |
    | Organisation      | xxxxxxxxxxxxxxxxxxxxxxxxx                                   |
    | Country           | US                                                          |
    | Start Datetime    | 2020-02-04 11:56:01 UTC                                     |
    | End Datetime      | 2021-02-03 11:56:01 UTC                                     |
    +-------------------+-------------------------------------------------------------+
    
    
    +-------------------------------------+--------------------------------------+
    |                          Summary for sigh 2.141.0                          |
    +-------------------------------------+--------------------------------------+
    | app_identifier                      | xxxxxxxxxxxxxxxxxxxxxxxxx            |
    | username                            | xxxxxxxxxxxxxxxxxxxxxxxxx            |
    | force                               | false                                |
    | cert_id                             | 7D72F7MC75                           |
    | provisioning_name                   | match AdHoc xxxxxxxxxxxxxxxxxxxxxxxx |
    | ignore_profiles_with_different_name | true                                 |
    | team_id                             | R2Q6VXW97P                           |
    | team_name                           | xxxxxxxxxxxxxxxxxxxxxxxxx            |
    | platform                            | ios                                  |
    | adhoc                               | true                                 |
    | developer_id                        | false                                |
    | development                         | false                                |
    | skip_install                        | false                                |
    | skip_fetch_profiles                 | false                                |
    | skip_certificate_verification       | false                                |
    | readonly                            | false                                |
    +-------------------------------------+--------------------------------------+
    

    最佳答案

    解决方案

  • 正如@Scriptable 在他的评论中所说:

  • Because the Jenkins service runs like a daemon, it cannot access the login keychain, it uses the system keychain. Please make sure that your signing certificates are in the system keychain and see if this helps your issue.


  • 证书从未设置为 永远信任 ,它必须是 使用系统默认值

  • enter image description here

    关于ios - Jenkins/faSTLane - 没有找到本地代码签名身份,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60058504/

    相关文章:

    ios - 自动递增到不同节表中的每个单元格

    java - Spring 启动: Jenkins removes escaped double quote character from commands

    react-native - 如何在 xcworkspace 项目中使用 "increment_build_number"?

    jenkins - 如何在 Jenkins 脚本控制台中包含共享库?

    ios - FaSTLane 健身房导出 .app

    ios - FaSTLane Gym 配置 Ad Hoc Distribution

    ios - 如何通过iOS 11控制中心触发广播上传扩展?

    ios - UIPageViewController同时调用viewControllerBeforeViewController和viewControllerAfterViewController

    ios - UIAlertController 中的组或分隔符与新的音乐应用程序一样

    c# - 使用 vstest.console.exe 工具运行 Selenium 测试时显示测试的 URL