xcode Fastlane无法检测到iOS App Development配置文件

pvabu6sv  于 2023-11-21  发布在  iOS
关注(0)|答案(1)|浏览(253)

我正在使用Fastlane脚本来设置使用CI/CD的自动ios构建。在构建期间,Fastlane无法检测到开发配置文件。我收到以下错误

错误:找不到“my-app-identifier”的配置文件:Xcode找不到任何与“my-app-identifie”匹配的iOS App Development配置文件。自动签名已禁用,无法生成配置文件。要启用自动签名,请将-allowProvisioningUpdates传递到xcodebuild。(在项目“App-scheme”的目标“My-target”中)

默认情况下,在Xcode的自动设置代码签名是启用的,并试图禁用它。并选择证书后,我能够建立与Fastlane的iOS应用程序。
我已经提供了build_app函数的配置文件详细信息。是否可以通过Fastlane选择配置文件?

快速文件

  1. default_platform(:ios)
  2. platform :ios do
  3. before_all do |lane, options|
  4. APP_ID=ENV['APP_ID']
  5. APP_SCHEME=ENV['APP_SCHEME']
  6. setup_ci
  7. end
  8. desc "Fetches the provisioning profiles so you can build locally and deploy to your device"
  9. lane :certs do
  10. match(app_identifier: [APP_ID], type: "appstore", readonly: true, git_branch: "new-2")
  11. match(app_identifier: [APP_ID], type: "development", readonly: true, git_branch: "new-2")
  12. match(app_identifier: [APP_ID], type: "adhoc", readonly: true, git_branch: "new-2")
  13. end
  14. desc "Description of what the lane does"
  15. lane :beta do
  16. # add actions here: https://docs.fastlane.tools/actions
  17. # increment_build_number
  18. connect_appstore_api
  19. build_app(
  20. scheme: APP_SCHEME,
  21. export_method: "app-store",
  22. output_directory: "./build/appstore/",
  23. clean: true,
  24. archive_path: "./build/build",
  25. export_options: {
  26. provisioningProfiles: {
  27. APP_ID => "match AppStore #{APP_ID}",
  28. }
  29. }
  30. )
  31. # pilot
  32. end
  33. desc "Generate certificates"
  34. lane :generate_certs do
  35. connect_appstore_api
  36. match(
  37. app_identifier: [APP_ID],
  38. type: "development",
  39. readonly: false,
  40. git_branch: "new-2"
  41. )
  42. match(
  43. app_identifier: [APP_ID],
  44. type: "adhoc",
  45. readonly: false,
  46. git_branch: "new-2"
  47. )
  48. match(
  49. app_identifier: [APP_ID],
  50. type: "appstore",
  51. readonly: false,
  52. git_branch: "new-2"
  53. )
  54. end
  55. private_lane :connect_appstore_api do
  56. app_store_connect_api_key(
  57. duration: 1200, # optional (maximum 1200)
  58. in_house: false,
  59. is_key_content_base64: true
  60. )
  61. end
  62. lane :check_ci do
  63. if is_ci
  64. puts "I'm a computer"
  65. else
  66. puts "Hi Human!"
  67. end
  68. end
  69. end

字符串

9jyewag0

9jyewag01#

我一直在和同样的问题斗争一段时间。我在gitactions上使用fastlane和nativescript。我终于成功地让构建的归档阶段工作了。
1.确保你有setup_ci(文档)在你的车道你跑。我不知何故错过了这部分的文档。这将整理你的钥匙链等。上面的Fastfile确实有setup_ci
1.请确保您使用app_store_connect_api_key(docs)进行匹配以进行身份验证,因为2FA在ci/cd中不起作用。虽然我已经设置了这个,但我实际上没有运行该命令,并且匹配使用我的应用程序密码然后询问安全代码。上面的Fastfile使用了connect_appstore_api,我在docs中找不到。
1.通过使用update_code_signing_settings(docs)禁用自动代码签名。在构建之前运行此命令,例如在build_app之前。尽管上面的错误说,我真的很难让任何东西在启用代码签名的情况下工作。在调用此函数时,您还应该包括您的profile_name,因为它会告诉xcode使用什么配置文件。下面是一个示例,

  1. update_code_signing_settings(
  2. use_automatic_signing: false,
  3. path: "./platforms/ios/nativescript.xcodeproj",
  4. team_id: "YOUR-TEAM-ID",
  5. profile_name: "match AppStore YOUR.BUNDLE.ID",
  6. )

字符串
注意profile_name。如果你运行fastlane match appstore,你会看到用于appstore分发的配置文件。我想它看起来会像我在例子中看到的那样,但只是为了确保命令会告诉你你的profile_name参数应该是什么。
1.在本地测试你的构建。如果没有setup_ci,但有了应用商店API、匹配、禁用代码签名和指定配置文件,一切都应该在本地构建。如果没有,检查错误并进行必要的更改。例如,我不得不更改我的build.xcconfig以包含CODE_SIGN_IDENTITY,以显式地告诉excode要使用什么idendity,

  1. CODE_SIGN_IDENTITY = Apple Distribution: APP STORE ACCOUNT (TEAMID)


您可以使用fastlane match appstore来获取此标识。它将被称为“证书名称”
我现在可以很好地构建应用程序。我的新问题是它看起来不像是自动递增构建号,所以应用程序商店拒绝应用程序。这可能与关闭代码签名有关... brb...

展开查看全部

相关问题