npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-debug-toolkit

v3.1.4

Published

A local-first React Native debugging bridge with in-app logs, desktop daemon, Web Console, HTTP API, and MCP support

Downloads

1,429

Readme

React Native Debug Toolkit

English

React Native 开发期调试面板 + 本地日志桥。

它能在 App 内看日志,也能把同一台设备的日志流发到本机 daemon,供浏览器、curl、脚本、MCP 读取。

模型

RN App logs -> Debug Panel -> local daemon -> Web Console / HTTP / MCP

采集:

  • Network
  • Console
  • Navigation
  • Track
  • Zustand

CLI daemon 默认把设备日志持久化到 ~/.react-native-debug-toolkit/daemon-devices.json。 用 DELETE /devices 清空已存日志。

安装

npm install react-native-debug-toolkit

可选:

npm install @react-native-clipboard/clipboard
npm install @react-native-async-storage/async-storage

App 接入

import { DebugView } from 'react-native-debug-toolkit';

export function App() {
  return (
    <DebugView>
      <AppContent />
    </DebugView>
  );
}

开发模式打开 App。点击 DBG

禁用功能:

<DebugView features={{ clipboard: false, zustand: false }}>
  <AppContent />
</DebugView>

导航追踪:

<DebugView navigationRef={navigationRef}>
  <NavigationContainer ref={navigationRef}>
    <AppContent />
  </NavigationContainer>
</DebugView>

Zustand:

import { zustandLogMiddleware } from 'react-native-debug-toolkit';

Track:

import { addTrackLog } from 'react-native-debug-toolkit';

addTrackLog({ eventName: 'button_click' });

Desktop Logs

启动 daemon:

npx debug-toolkit --daemon-only

默认设备日志存储文件:~/.react-native-debug-toolkit/daemon-devices.json。 可用 --store /path/to/devices.jsonDEBUG_TOOLKIT_DAEMON_STORE 覆盖。

打开:

http://127.0.0.1:3799/console

App 内:Debug Panel -> 齿轮 -> Send OnceStart Live Sync

Endpoint:

| 运行时 | Endpoint | | --- | --- | | iOS simulator | http://localhost:3799 | | Android emulator | http://10.0.2.2:3799 | | 真机 | http://<mac-ip>:3799 |

真机规则:手机浏览器必须能打开 http://<mac-ip>:3799/health。打不开就查防火墙、Wi-Fi 隔离、VPN、明文 HTTP。

HTTP

BASE=http://127.0.0.1:3799

curl "$BASE/health"
curl "$BASE/devices"
curl "$BASE/devices/latest"

DEVICE_ID=$(curl -s "$BASE/devices" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>console.log((JSON.parse(s).devices||[])[0]?.deviceId||''))")

curl "$BASE/devices/$DEVICE_ID"
curl "$BASE/devices/$DEVICE_ID/logs?limit=100"
curl "$BASE/devices/$DEVICE_ID/logs?limit=100&includeBodies=true"
curl "$BASE/devices/$DEVICE_ID/logs?type=network&failedOnly=true&limit=50"
curl "$BASE/devices/$DEVICE_ID/logs?type=console&limit=100"
curl "$BASE/devices/$DEVICE_ID/logs?entryId=<entryId>"
curl -X DELETE "$BASE/devices"

主要端点:

GET    /health
POST   /report
POST   /ingest
GET    /devices
GET    /devices/latest
GET    /devices/:deviceId
GET    /devices/:deviceId/logs?type=&limit=&failedOnly=&includeBodies=&entryId=
DELETE /devices
GET    /events
GET    /console

MCP

claude mcp add debug-toolkit -- npx debug-toolkit

工具:

  • list_app_devices
  • get_app_logs — 默认不含 body;设置 includeBodies=true 或传 entryId 获取详情

有 shell 时优先 curl。

导出

  • DebugView
  • DebugToolkit
  • initializeDebugToolkit
  • createDebugDeviceReport
  • checkDaemonConnection
  • reportDebugDeviceToDaemon
  • startStreaming
  • stopStreaming
  • isStreaming
  • autoDetectDaemonIp
  • feature factories and types

边界

  • 开发工具,不是生产监控。
  • 本地 daemon,不是云 replay。
  • Network 日志只是监测流量,不做 auth/token 分析。
  • 不默认脱敏。
  • 不替代 React Native DevTools。

许可证

MIT