firebase/agent-skills

xcode-project-setup

在macOS上为已有Xcode工程连接SPM依赖

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

xcode-project-setup 是什么?

xcode-project-setup 为已有Xcode项目添加Swift Package依赖和产品模块,使用附带Swift工具处理工程关联,也能链接GoogleService-Info.plist。它明确区分包依赖、目标模块链接与现代目录同步。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • iOS项目需要通过SPM接入Firebase、Alamofire等依赖并关联实际产品模块。

这些情况不适合

  • 没有Xcode工程就凭空编辑pbxproj,或在Windows直接执行依赖macOS的工程配置。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 xcode-project-setup,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 xcode-project-setup

请在 Codex 的当前工作环境中安装并检查 xcode-project-setup 这个 Skill。

项目身份:firebase/agent-skills / xcode-project-setup
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/xcode-project-setup/SKILL.md
已定位的源文件:skills/xcode-project-setup/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • macOS、可用Swift和已有.xcodeproj/.xcworkspace;保留scripts/xcode_spm_setup,并确定目标工程、包仓库、版本及产品模块。

会得到什么

  • 已添加的包与产品链接、可选plist关联、实际构建结果及工程改动。

实际使用顺序

  1. 先运行swift --version并核对真实工程。没有工程时需先在Xcode创建,不能用字符串拼出替代工程。
  2. 找到Skill目录中的Swift配置包,按源文swift run签名传入真实工程、仓库和已核对版本,以及需要链接的产品模块。
  3. Firebase需要配置文件时传入实际plist;工具按来源同时建立仓库依赖与target链接,避免只添加包却没链接模块。
  4. 核对构建设置与实际构建,Firebase静态链接遇到相关运行问题时检查OTHER_LDFLAGS中的-ObjC;新文件仅在工程使用目录同步时按该机制接入。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

在我的macOS工程中用 xcode-project-setup 接入FirebaseAuth。先检查Swift、工程与目标target,核对Firebase iOS SDK实际发布版本,再使用附带Swift工具添加包和产品,关联已有plist。保留工程备份,说明-ObjC设置与实际构建结果,不手写sed修改pbxproj。
预期结果

预期包依赖、target产品与配置文件对应真实工程;本站未在macOS执行本例。

使用前先看这些限制

使用条件与边界

  • 原文的罚款话术不是可验证产品能力,不作为本站建议;必要信息是实际工具链和工程约束。
  • 目录同步是特定Xcode工程特性,不能据源文假定所有旧项目写入文件后都会自动加入target。
针对这个 Skill 的疑问

常见问题

添加包仓库就够了吗?

不够。还需要给目标target链接具体产品模块,来源的Swift工具同时处理这两件事。

示例中的11.0.0能直接使用吗?

源文明确把它当示例,实际应先核对官方release与项目兼容版本,不能据旧例声称最新。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-19T19:32:10.677Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/xcode-project-setup/SKILL.md · 抓取时间 2026-11-19T19:32:10.677Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

查看源文件章节 / Source sections
  • 原文:Xcode Project Setup
  • 原文:⛔️ CRITICAL RULES & ENVIRONMENT CHECKS
  • 原文:1. The Anti-Ruby Mandate
  • 原文:2. Modern Xcode Folder Synchronization
  • 原文:3. Allowed Scripting Languages
  • 原文:4. Toolchain Verification
  • 原文:5. Mandatory Linker Flags for Static Frameworks (Firebase)
  • 原文:Empty Directory Workflow
  • 原文:Standard Xcode Workflow
  • 原文:**CRITICAL: Always Use Latest SDK Version**
  • 原文:Understanding the Script's Actions
  • 使用方法 / Usage
  • 原文:Example 1: Generic Package (e.g., Alamofire)
  • 原文:Example 2: Firebase (Requires Plist)
原文:⛔️ CRITICAL RULES & ENVIRONMENT CHECKS

Before performing any Xcode setup or file manipulation, you **MUST** adhere to the following rules. A hefty fee will be applied if you violate them.

原文:1. The Anti-Ruby Mandate

You are **strictly forbidden** from using Ruby, Rails, or any Ruby gems (including the `xcodeproj` gem). Under no circumstances may you write or execute Ruby scripts.

原文:2. Modern Xcode Folder Synchronization

Modern Xcode projects support folder synchronization. When adding new source code (`.swift`) or resource files, simply write them to the correct directory on disk. They will be automatically included in the Xcode project. **Never manually modify the `.pbxproj` file to add files.**

原文:3. Allowed Scripting Languages

If you absolutely must write a script to manipulate the project environment (e.g., configuring SPM packages beyond what the provided `xcode_spm_setup` script does), you **must use Swift**. Only as an absolute last resort, if Swift is completely unviable, may you use Node.js or TypeScript.

原文:4. Toolchain Verification

Because this skill relies entirely on a native Swift script, you must verify the environment: - Run `swift --version` before proceeding. - If the Swift command is not found, you must stop and recommend the user install the Swift toolchain (e.g., via `xcode-select --install` on macOS), or ask if you can attempt to install it for them. Do not attempt to proceed without Swift.

原文:5. Mandatory Linker Flags for Static Frameworks (Firebase)

When setting up SPM dependencies that heavily rely on internal Objective-C categories and `+load` methods (such as the Firebase iOS SDK suite), the Apple linker will aggressively strip these methods out if they are linked statically. This causes fatal runtime crashes (e.g., `FirebaseAuth/Auth.swift:167: Fatal error: Unexpectedly found nil`). **The provided `xcode_spm_setup` Swift script automatically injects the `-ObjC` flag to `OTHER_LDFLAGS` when adding Firebase products.** However, you should still verify it is present in the build settings if you encounter issues. - Failing to include this flag when adding Firebase dependencies is a critical error. ______________________________________________________________________

文件 SHA256:e96d445e9bdbdb5b9b70da095374175f84d842e4778225101a9f07fa57d5bdc2

仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。

Skills.sh收录简介 · 2026-07-28

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g.…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识xcode-project-setup
来源仓库firebase/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次279
快照累计安装量74147

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源