This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo DevClient
一个允许创建开发构建并包含实用开发工具的库。
Android
iOS
tvOS
expo-dev-client 为你的调试构建添加了各种有用的开发工具:
- 可配置的启动器 UI,因此你可以启动更新(例如来自 PR 预览的更新),并在不同的开发服务器之间切换,而无需重新编译原生应用
- 改进的调试工具(例如支持检查网络请求)
- 功能强大且可扩展的开发者菜单 UI
Expo 文档将包含 expo-dev-client 的调试构建称为开发构建。
安装
Terminal
如果你要在一个现有的 React Native 应用中安装,请先在你的项目中安装expo。然后,按照在现有 React Native 项目中安装 expo-dev-client中的说明进行操作。
应用配置中的配置
如果你在项目中使用配置插件(Continuous Native Generation (CNG)),可以使用其内置的 config plugin 来配置开发客户端启动器。该插件允许你配置各种无法在运行时设置的属性,这些属性需要构建一个新的应用二进制文件后才会生效。如果你的应用不使用 CNG,那么你需要手动配置该库。
Example app.json with config plugin
app.json
Configurable properties
TV 支持
- 此库仅在 SDK 54 及更高版本中支持 TV。
- Android TV:支持所有操作,与 Android 手机类似。
- Apple TV:支持使用本地或隧道化打包器进行基本操作。尚不支持 EAS 认证以及 EAS 构建和更新列表。
API
import * as DevClient from 'expo-dev-client';
Methods
A method that closes development client menu when called.
Returns:
voidA method that hides development client menu when called.
Returns:
voidA method that opens development client menu when called.
Returns:
void