You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行fastlane match报错:无法通过App Store Connect API判定团队类型

Fastlane match生成证书时报「无法判断账号类型」错误的解决方案

问题场景

我维护一款发布至App Store的iOS应用,使用Fastlane完成构建分发流程,当前项目的证书和描述文件已过期。尝试使用fastlane match生成新的证书,操作前已删除Fastlane关联的Git仓库中存储的所有过期证书,运行命令时收到如下报错:

[16:50:09]: If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.
[16:50:10]: Checking out branch master...
[16:50:10]: 🔓  Successfully decrypted certificates repo
[16:50:10]: Verifying that the certificate and profile are still valid on the Dev Portal...
[16:50:10]: Creating authorization token for App Store Connect API
[16:50:11]: Couldn't find a valid code signing identity for distribution... creating one for you now

+-------------------------+-----------------------------------------------------------------------------------------------------------------+
|                                                         Summary for cert 2.177.0                                                          |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+
| platform                | ios                                                                                                             |
| development             | false                                                                                                           |
| generate_apple_certs    | true                                                                                                            |
| force                   | true                                                                                                            |
| api_key_path            | **** |
| username                |  redacted                                                                                             |
| team_id                 | redacted
| keychain_path           | /Users/jenkins/Library/Keychains/login.keychain-db                                                              |
| keychain_password       | ********                                                                                                        |
| skip_set_partition_list | false                                                                                                           |
+-------------------------+-----------------------------------------------------------------------------------------------------------------+

[16:50:11]: Creating authorization token for App Store Connect API
+---------------+------+
|     Lane Context     |
+---------------+------+
| PLATFORM_NAME |      |
| LANE_NAME     | beta |
+---------------+------+
[16:50:11]: Cannot determine if team is App Store or Enterprise via the App Store Connect API (yet). Set 'in_house' on your Spaceship::ConnectAPI::Token. Or set 'in_house' in your App Store Connect API key JSON file. Or set the 'SPACESHIP_CONNECT_API_IN_HOUSE' environment variable to 'true'.

报错原因

Fastlane调用App Store Connect API时无法自动识别当前开发者账号的类型(普通App Store账号/企业内部分发账号),需要手动传入标识参数才能继续执行证书生成逻辑。

解决方案

根据你使用的鉴权方式选择对应操作即可:

  • 若通过App Store Connect API密钥JSON文件鉴权(本案例中Jenkins构建使用的就是该方式):直接在JSON配置文件中添加in_house: false即可,普通App Store开发者账号填false,企业级内部分发账号填true
  • 若通过环境变量配置鉴权参数:新增环境变量SPACESHIP_CONNECT_API_IN_HOUSE,按账号类型设置对应值为true或false
  • 若在Fastlane脚本中直接初始化接口Token:给Spaceship::ConnectAPI::Token对象增加in_house参数赋值

内容的提问来源于stack exchange,提问作者Shapebuster

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.26 03:36:02