@axonpack/expo-devtools

中文文档
3.9.0发布于 2026/11/04MITTypeScriptCommonJS构建来源已验证近 30 天下载 3015

Development Debugging tool for React Native

原始使用文档
文档目录6 节
  1. Installation
  2. Setup
  3. For AI agents
  4. Documentation
  5. Example app
  6. What's built, and what isn't
Axonpack

@axonpack/expo-devtools

Browser-style devtools that live inside your React Native or Expo app.

Tap a floating button for eleven tabs on the device itself: Network (every request, resendable, with throttling), Console (every log, plus a prompt that answers), Performance (frame rate, memory, the moments the app froze), Storage (every key you've saved), Query, Navigation, Redux, Preview, Crashes, CLI and Debug. No desktop debugger, no cable, and nothing captured unless you switch it on.

Documentation · Quick start · Reference · Upgrading · Changelog

npm version npm downloads License: MIT

Network tab listing captured requests Console tab listing captured logs Performance tab showing frame rate and memory charts
Every request as it happens, in-app browser traffic included. Every log, with objects you can open up and explore. Frame rate, memory and startup, measured on the device.

Installation

npx expo install @axonpack/expo-devtools react-native-safe-area-context react-native-webview expo-clipboard

Those three are peer dependencies, so each resolves to the version your Expo SDK ships.

Setup

Wrap your app once, at the root. That is the whole setup: no config plugin, no app.json changes, no native code to write.

import { DevtoolsProvider } from '@axonpack/expo-devtools';

export default function App() {
  return (
    <DevtoolsProvider config={{ enabled: __DEV__ }}>
      <YourApp />
    </DevtoolsProvider>
  );
}

enabled is the only gate. With it off nothing is patched, nothing is recorded and no button is drawn, so the mount is safe to leave in a release build.

For the Network tab on your computer too, in its own tab in React Native DevTools, add one line to metro.config.js:

const { getDefaultConfig } = require('expo/metro-config');
const { withDevtools } = require('@axonpack/expo-devtools/metro');

module.exports = withDevtools(getDefaultConfig(__dirname));

Two things need a little more than that: an in-app browser takes the useDevtoolsWebView hook, and the Storage tab shows nothing until you register your stores in config.storage.adapters, because this package depends on no storage library and cannot discover one.

Supports connect the devtools to other packages. Each has its own entry point, @axonpack/expo-devtools/support/<name>/v<major>, never the main entry. Once you pass one in supports, it adds a tab, a topic in the devtools command line tool, and a useSupport() hook that returns the package's state. <major> is the major version of the package it supports. The first is preview, for @axonpack/preview 0.x:

import PreviewV0Support from '@axonpack/expo-devtools/support/preview/v0';

<DevtoolsProvider config={{ enabled: __DEV__, supports: [PreviewV0Support.configure(previewConfig)] }}>

A support whose package isn't installed, or is on another major, logs what to do and shows it in its tab, and never crashes the app. See Supports.

For AI agents

An AI agent, or you, can read what the devtools recorded from a terminal: requests with their bodies, logs, crashes, stored values and every other tab, filtered down to the rows it needs. It can also mock or block a URL, send a request from inside the app, call a function you handed to the Console tab's > prompt in console.context, and, with the preview support, switch, download, update or delete a preview.

npx devtools network --where state=error --since 10m
npx devtools context call store.dispatch '{"type":"cart/clear"}' --yes

It works with any package manager, needs Node 22 or newer and expo start, and keeps every redaction you configured, console.redactKeys and console.redact for what it reads through context included. The CLI tab lists each query and action, and the reply it got. Use with AI agents has every command, and a snippet to paste into your AGENTS.md or CLAUDE.md. The axonpack agent skill has your agent learn the whole tool from the docs: npx skills add axonpack/skills.

Documentation

Everything else is on the docs site.

PageWhat is on it
Quick startSetup for Expo Router or your own entry point, and the launcher button
GuidesOne page per tab, each ending in what it cannot measure and why
Use with AI agentsReading the devtools from a terminal, and a snippet for your agent
In-app browsersCapturing a <WebView />'s requests and logs
React Native DevToolsThe Network tab on your computer, with the sandbox and code snippets
Leaving it in productionWhat enabled: false does, and what still runs
ReferenceEvery control, every config option, every exported type
UpgradingWhat moved where in 3.0, coming from 2.x
ChangelogEvery published release, also in CHANGELOG.md

The same reference ships inside this package as REFERENCE.md, for reading offline.

Example app

example/ is a runnable Expo app with one screen per tab, each a wall of buttons that produces real traffic, logs, stalls and crashes to look at. It doubles as a worked configuration: a custom theme, a REPL context, all four storage adapters against real AsyncStorage, MMKV, SecureStore and an in-memory Map, and @axonpack/preview set up through its support.

cd example
bun run start   # Expo Go / dev client
bun run ios     # or: bun run android (full native build)

What's built, and what isn't

See the feature list for what's built, what the platform genuinely can't do (and why this doesn't fake it), and what's still on the table.

版本与发布记录

@axonpack/expo-devtools 共发布 40 个版本,首次发布于 2026/08/06;过去 12 个月发布了 40 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.9.0latest2026/11/043 天前
3.9.0-canary-0c8996737c81445e3afba17e5b80874eb9deb5a7canary2026/11/043 天前
3.9.0-canary-9fc85d04b66457581af92e0de2de2b5cedb5fab42026/11/043 天前
3.8.0-canary-706969f3e9dc342d03f481bb66f1f30d190843232026/11/034 天前
3.8.02026/11/034 天前
3.7.02026/11/034 天前

关于 @axonpack/expo-devtools 的常见问题

@axonpack/expo-devtools 是什么?

Development Debugging tool for React Native

如何安装 @axonpack/expo-devtools?

在项目目录运行 npm install @axonpack/expo-devtools,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:expo(*)、react(*)、react-native(*)、expo-clipboard(*)、react-native-webview(*)、react-native-safe-area-context(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 devtools,可以用 npx devtools 直接运行。

@axonpack/expo-devtools 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@axonpack/expo-devtools 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@axonpack/expo-devtools 可以商用吗?

@axonpack/expo-devtools 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@axonpack/expo-devtools 的下载量有多少?

根据 npm 官方下载统计,@axonpack/expo-devtools 在 2026/10/08 – 2026/11/06 这 30 天内被下载 3,015 次,日均约 101 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@axonpack/expo-devtools 还在维护吗?

最新版本 3.9.0 发布于 2026/11/04(3 天前);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/08/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。