This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

克劳德代码和Expo

使用 Claude Code 来构建、升级、调试和部署你的 Expo 和 React Native 项目。


Claude Code 是 Anthropic 的基于终端的 AI 编码代理。它可以理解你的整个代码库,提出修改建议,运行终端命令,并管理 git 操作。用 create-expo-app 创建的 Expo 项目会包括 AGENTS.md 来提供项目上下文。当安装了 Claude Code 后,这些项目还会包含 .claude/settings.json 来启用 Expo 插件。它还可以查看 EAS 和 Expo CLI 的日志,从 Expo 模型上下文协议 (MCP) 服务器获取文档,使用 Expo 技能获取最佳实践,管理你的 EAS 部署工作流等等。

🌐 Claude Code is Anthropic's terminal-based AI coding agent. It can understand your entire codebase, propose edits, run terminal commands, and manage git operations. Expo projects created with create-expo-app include AGENTS.md for project context. When Claude Code is installed, these projects also include .claude/settings.json to enable the Expo plugin. It can also check EAS and Expo CLI logs, fetch documentation from the Expo Model Context Protocol (MCP) Server, use Expo Skills for best practices, manage your EAS deployment workflow, and more.

快速开始

🌐 Quick start

1

安装Claude代码

🌐 Install Claude Code

全局安装 Claude Code,然后可以从任何项目启动它。有关其他安装方法,请参阅 Claude Code 文档。

🌐 Install Claude Code globally, then start it from any project. For other install methods, see the Claude Code documentation.

Terminal
- curl -fsSL https://claude.ai/install.sh | bash

2

创建一个新的 Expo 项目

🌐 Create a new Expo project

使用以下命令创建一个项目,或确保你现有的项目已安装最新的 expo 包。

🌐 Create a project with the following command or ensure your existing project has the latest expo package installed.

Terminal
- npx create-expo-app@latest
- yarn create expo-app
- pnpm create expo-app
- bun create expo

3

安装 Expo 插件

🌐 Install the Expo plugin

安装官方的 Expo 插件,这样 Claude Code 就能了解 Expo 的规范,并且可以处理你的 EAS 项目。一个命令就能安装 Expo 技能并注册 Expo MCP 服务器:

🌐 Install the official Expo plugin so Claude Code knows Expo conventions and can work with your EAS projects. One command installs Expo Skills and registers the Expo MCP Server:

Terminal
- claude plugin install expo@claude-plugins-official

然后在你的 Claude Code 会话中运行 /mcp 来登录你的 Expo 账号。

🌐 Then run /mcp inside your Claude Code session to sign in to your Expo account.

下面的指南涵盖了可用的技能以及MCP服务器的其他功能:

🌐 The guides below cover the available skills and everything else the MCP Server can do:

Expo 技能

浏览插件提供的完整技能列表,并查看其他代理的安装选项。

Expo MCP 服务器

连接远程 Expo MCP 服务器以让代理实时访问 Expo 文档和 EAS。

4

打开你的项目并开始提示

🌐 Open your project and start prompting

从你的项目根目录运行 Claude 代码,然后描述你想要做的事情。

🌐 Run Claude Code from your project root, then describe what you want to do.

Terminal
- cd my-app

- claude

5

验证设置

🌐 Verify setup

将以下提示粘贴到你的 Claude Code 会话中,以确认它可以读取你的项目:

🌐 Paste the following prompt in your Claude Code session to confirm it can read your project:

Example prompt
Open package.json and tell me which Expo SDK version this project targets.

如果代理回复的是来自 package.json 的 SDK 版本,则说明代理正在正确读取你的项目。

🌐 If the agent replies with the SDK version from package.json, the agent is reading your project correctly.

Claude Code 如何读取你的 Expo 项目

🌐 How Claude Code reads your Expo project

当你在项目中启动 Claude Code 时,它会读取两个脚手架文件:

🌐 When you start Claude Code in your project, it reads two of the scaffolded files:

  • AGENTS.md 指向 Claude Code 获取你项目 Expo SDK 版本的文档。在这个文件中添加项目级别的说明,这样你的代理就能读取相同的上下文。
  • .claude/settings.json 启用来自 Claude Code 插件市场的官方 Expo 插件 (expo@claude-plugins-official)。

两个文件都已提交到你的项目中,因此开发者的 Claude 代码会话从相同的上下文开始。

🌐 Both files are committed to your project, so a developer's Claude Code session starts from the same context.

示例提示

🌐 Example prompts

设置完成后,用简单的语言描述 Expo 任务。例如:

🌐 After setup, describe Expo tasks in plain language. For example:

任务示例提示
升级 SDK将此项目升级到最新的 Expo SDK 并修复任何破坏性更改。
添加导航使用 Expo Router 添加一个标签导航器和新的设置屏幕。
自动化构建创建一个 EAS 工作流,在每次拉取请求时构建应用。
调试构建我最近的 iOS 构建失败了。读取 EAS 构建日志并告诉我出了什么问题。
添加通知配置 expo-notifications,并在应用启动时显示本地通知。
设置 CI/CD创建一个在每次 PR 时构建的 CI/CD 工作流。
添加原生 UI向我的 Expo 应用添加一个 SwiftUI 选择器组件。
检查反馈显示我的应用的 TestFlight 反馈。
验证 UI截屏并验证蓝色圆形视图。

更多示例,请参见 Expo Skills 和 Expo MCP Server 的示例提示部分。

🌐 For more examples, see the Example prompts sections of Expo Skills and Expo MCP Server.

故障排除

🌐 Troubleshooting

项目设置中启用了插件 'expo',但此处未安装。

如果你在 Claude Code 会话中看到此错误,那么你需要在开发者机器上安装官方 Expo 插件。要安装它,请在终端窗口中运行以下命令,然后重新启动你的 Claude Code 会话:

🌐 If you see this error in your Claude Code session, then you need to install the official Expo plugin on your developer machine. To install it, run the following command in the terminal window and then restart your Claude Code session:

Terminal
- claude plugin install expo@claude-plugins-official

上述命令会全局安装 Expo 插件。如果你只想为这个项目安装它,请在命令中添加 --scope project:

🌐 The above command installs the Expo plugin globally. If you want to install it just for this project, add --scope project to the command:

Terminal
- claude plugin install expo@claude-plugins-official --scope project