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

在Azure DevOps iOS构建流水线中使用GoogleService-Info.plist作为机密文件

iOS端实现方案说明

针对你的问题,iOS端只需要将GoogleService-Info.plist复制到正确的目录即可,无需额外配置Xcode文件链接——前提是你的Flutter项目本地开发阶段已经完成了Firebase的初始化配置(即GoogleService-Info.plist已被添加到Xcode项目的Runner目标中,且在Build Phases > Copy Bundle Resources列表里)。

Azure DevOps流水线配置示例

对应Android端的实现,iOS端的流水线任务配置如下:

- task: DownloadSecureFile@1
  enabled: true
  name: google_services_plist
  inputs:
    secureFile: GoogleService-Info.plist

- script: |
    cp "$(google_services_plist.secureFilePath)" "$(Build.SourcesDirectory)/ios/Runner/GoogleService-Info.plist"
  displayName: 'Copy GoogleService-Info.plist to iOS Runner directory'
  enabled: true

关键说明

  • 路径准确性:Flutter iOS项目中GoogleService-Info.plist的标准存放位置是ios/Runner/,确保复制路径与项目结构一致。
  • 无需修改Xcode配置:本地开发时已经完成的Xcode关联配置(文件加入项目、Bundle资源列表)会被流水线中的Xcode构建任务继承,只要文件存在于指定目录,Xcode会自动将其打包进IPA。
  • 验证建议:构建完成后可以解压IPA包,检查Contents/Resources目录下是否存在GoogleService-Info.plist,确认文件已被正确打包。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.15 13:40:25