360 Secure SkillHub
360 安全技能中心

React Native Logs

该 Skill 描述如何用 rn-logs CLI 经 CDP 获取 React Native 应用的 Metro 日志:全局安装后列出已连接应用,按应用流式读取或按条数快照日志,默认纯文本输出,可指定 Metro 主机与端口,并给出常见失败原因与处理建议。

分类:开发
okwasniewski
okwasniewski
热度 50.97
最近更新 2026-05-17 12:40:19

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add okwasniewski/react-native-logs-cli
兼容性
通用兼容
联网要求
需要联网
数据出网
数据不出本机
Metadata
name
react-native-logs-cli
description
Use rn-logs to read React Native Metro logs via CDP without MCP overhead. Default output is plain text and safe for non-interactive agent runs.
license
MIT
metadata
{"author":"okwasniewski","version":"1.0.0"}

rn-logs cli

Use rn-logs to read React Native Metro logs via CDP without MCP overhead. Default output is plain text and safe for non-interactive agent runs.

When to use

  • You need live Metro logs from a running RN app
  • You want low-context, plain text log output

Installation

npm install -g rn-logs-cli
bun add -g rn-logs-cli

Then verify:

rn-logs --help

Requirements

  • rn-logs is installed and available in PATH
  • Metro is running
  • App is running on a simulator or device

Core workflow

# 1. List connected apps
rn-logs apps

# 2. Stream logs
rn-logs logs --app "<id|name>"

# 3. Snapshot logs
rn-logs logs --app "<id|name>" --limit 50

Command options

# Changing default port or host
rn-logs "[command]" --host "<host>"    # Metro host (default: localhost)
rn-logs "[command]" --port "<port>"    # Metro port (default: 8081)

rn-logs help

Non-interactive mode

  • When multiple apps are connected, you must pass --app.
  • Output is plain text for agent-friendly consumption.

Common failures

  • metro not reachable -> start Metro or fix host/port
  • no apps connected -> run app on simulator or device
  • multiple apps connected -> pass --app