升级 Expo SDK
了解如何增量升级项目中的 Expo SDK 版本。
信息 我们建议逐步升级 SDK 版本,每次只升级一个版本。这样可以帮助你在升级过程中准确定位出现的问题和故障。
随着新SDK的发布,最新版本进入当前发布状态。这适用于Expo Go,因为它只支持最新的SDK版本,旧版本将不再受支持。我们建议在生产应用中使用开发版本,因为旧SDK版本在EAS服务上的向后兼容性通常会持续较长时间,但并非永久。
🌐 With a new SDK release, the latest version enters the current release status. This applies to Expo Go as it only supports the latest SDK version and previous versions are no longer supported. We recommend using development builds for production apps as the backwards compatibility for older SDK versions on EAS services tends to be much longer, but not forever.
如果你想安装特定版本的 Expo Go,请访问 expo.dev/go。它支持在 Android 设备/模拟器和 iOS 模拟器上下载。然而,由于 iOS 平台的限制,只有最新版本的 Expo Go 可以在实际的 iOS 设备上安装。
🌐 If you are looking to install a specific version of Expo Go, visit expo.dev/go. It supports downloads for Android devices/emulators and iOS simulators. However, due to iOS platform restrictions, only the latest version of Expo Go is available for installation on physical iOS devices.

如何升级到最新的 SDK 版本
🌐 How to upgrade to the latest SDK version
1
升级 Expo SDK
🌐 Upgrade the Expo SDK
安装新版 Expo 包:
🌐 Install the new version of the Expo package:
- npm install expo@^54.0.0根据你要升级到的 SDK,将 expo@^54.0.0 替换为你目标的 Expo SDK 版本范围。例如,expo@^54.0.0 代表 SDK 54。
🌐 Depending on which SDK you're upgrading to, substitute the expo@^54.0.0 with the version range of the Expo SDK version you're targeting. For example, expo@^54.0.0 stands for SDK 54.
2
升级依赖
🌐 Upgrade dependencies
将所有依赖升级以匹配已安装的 SDK 版本。然后运行 expo-doctor 命令检查常见问题。
🌐 Upgrade all dependencies to match the installed SDK version. Then run expo-doctor command to check for common problems.
- npx expo install --fix- npx expo-doctor3
更新本地项目
🌐 Update native projects
- 如果你使用 Continuous Native Generation:如果你在本地项目目录中为之前的 SDK 版本生成过 android 和 ios 目录,请删除它们。下次无论是使用
npx expo run:ios、npx expo prebuild还是 EAS Build 构建时,它们都会被重新生成。 - 如果你不使用 Continuous Native Generation:如果你有 ios 目录,请运行
npx pod-install。应用来自 Native 项目升级助手 的任何相关更改。或者,你可以考虑 采用 prebuild,以便将来更轻松地升级。
4
请查看发行说明以获取其他说明
🌐 Follow the release notes for any other instructions
阅读你要升级到的 SDK 版本的 SDK 更新日志。其中包含关于重大更改、弃用功能以及可能影响你应用的其他更改的重要信息。有关任何额外的说明,请参考发布说明页面底部的“升级你的应用”部分。
🌐 Read the SDK changelogs for the SDK version you are upgrading to. They contain important information about breaking changes, deprecations, and other changes that may affect your app. Refer to the "Upgrading your app" section at the bottom of the release notes page for any additional instructions.
SDK 更新日志
🌐 SDK Changelogs
每个 SDK 发布说明公告帖子都包含弃用信息、重大变更以及任何可能特有于该特定 SDK 版本的内容。在升级时,请务必查看这些信息,以确保不会遗漏任何内容。
🌐 Each SDK announcement release notes post contains information deprecations, breaking changes, and anything else that might be unique to that particular SDK version. When upgrading, be sure to check these out to make sure you don't miss anything.
已弃用的 SDK 版本更新日志
🌐 Deprecated SDK Version Changelogs
以下博客文章可能包含过时的信息,但如果你在 SDK 升级方面落后较多,它们仍然具有参考价值。
🌐 The following blog posts may included outdated information, but they are still useful for reference if you happen to fall far behind on SDK upgrades.