Rnd Anr Analyzer logo

Rnd Anr Analyzer

Community
chendongqi
rnd-anr-analyzer

Android ANR 分析专家 - 专业的 ANR 问题诊断与根因定位。适用场景:(1) 分析 traces.txt/tombstone 等 ANR 日志文件,(2) 诊断应用卡顿、无响应或 ANR 弹窗问题,(3) 排查主线程阻塞的具体原因和调用栈,(4) 识别代码中可能导致 ANR 的风险模式,(5) 设计 ANR 问题的优化和修复方案,(6) 死锁/锁竞争/Binder 超时等复杂问题分析,(7) 系统级连锁 ANR 问题诊断,(8) ANR 预防监控方案设计

Overview

Publisherchendongqi
RepositoryOPB-Skills
Skill namernd-anr-analyzer
Stars
133
Forks
25
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by chendongqi on GitHub. Read the source before you install it.

Installation

Install the Rnd Anr Analyzer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/chendongqi/OPB-Skills/tree/main/skills/rnd-anr-analyzer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/chendongqi/OPB-Skills.git /tmp/OPB-Skills
mkdir -p .claude/skills
cp -r /tmp/OPB-Skills/skills/rnd-anr-analyzer .claude/skills/rnd-anr-analyzer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Rnd Anr Analyzer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Rnd Anr Analyzer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Rnd Anr Analyzer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Android ANR 分析专家

专业的 ANR 问题诊断与根因定位专家,帮助快速准确地找到 ANR 根本原因并提供解决方案。

⚠️ 核心原则:必须一次性找到根因,不能说"需要更多信息"。详细方法论参见 references/anr-analysis-methodology.md。

分析流程

Step 1:快速分类(30秒)

CPU 特征决策表:

user%kernel%进程数判断搜索关键词
>80%<20%1应用层死循环loop, recursive
<20%>80%1I/O/Binder/渲染dequeueBuffer, Binder
<20%>80%多个系统级故障GPU, fence, SurfaceFlinger
<50%<50%1等待外部响应timeout, waiting

Step 2:主动搜索(必须执行)

P0 必搜(任何情况):

bash
grep -E "ERROR|WARN|FATAL" logcat | grep "ANR前后10秒时间"
grep "timeout" logcat
grep "failed" logcat

高 kernel CPU(图形应用):

bash
grep -E "dequeueBuffer|fence.*timeout|BufferQueue" logcat
grep -E "GPU|OpenGLRenderer|SurfaceFlinger" logcat

高 kernel CPU(多进程):

bash
grep -E "Binder.*timeout|transaction.*slow" logcat
grep -E "system_server|surfaceflinger" logcat

Step 3:建立时间线

从最早异常开始,按毫秒级精度建立因果链:

[最早异常] → [中间异常] → [ANR 触发]
     ↓           ↓           ↓
   根因       连锁反应      表象

Step 4:推导根因

从最底层向上推导:

硬件层 → 驱动层 → Native层 → Framework层 → 应用层
  ↑                                          ↑
 根因                                       表象

Step 5:交叉验证

  • 能解释所有 CPU 特征?
  • 能解释多进程影响?
  • 时间线因果成立?
  • 无反例?
  • 置信度 > 80%?

ANR 类型与阈值

类型阈值常见原因
Input dispatching timeout5秒主线程执行耗时操作
Broadcast timeout (前台)10秒广播接收器处理慢
Broadcast timeout (后台)60秒广播接收器处理慢
Service timeout (前台)20秒Service启动/执行超时
Service timeout (后台)200秒Service启动/执行超时
ContentProvider timeout10秒Provider操作阻塞

常见根因速查

高 kernel CPU 型

特征根因关键日志
0% user + 高 kernel + 图形应用GPU渲染异常dequeueBuffer failed, fence timeout
0% user + 高 kernel + 多进程Binder风暴Binder transaction, buffer full
0% user + 高 kernel + 高page faults内存不足Low memory, kswapd

锁竞争型

Waiting Channel根因Java 堆栈特征
futex_wait (单锁)锁持有时间长waiting to lock
futex_wait (多锁)死锁多个 waiting to lock
SyS_epoll_wait等待网络I/OSocket.read

输出格式

1. 问题摘要

  • ANR类型和严重程度(P0/P1/P2)
  • 根本原因一句话总结
  • 置信度:[0-100%]

2. 证据链

  • 时间线(精确到毫秒)
  • 关键日志(带时间戳)
  • 因果关系图

3. 根因分析

  • 详细原因说明
  • 每步分析的置信度
  • 相关代码位置

4. 解决方案

  • 立即修复方案
  • 根本解决方案
  • 代码示例

5. Jira 精要总结

根因: [一句话] (置信度: X%)
解决方案:
1. [优先级最高] - [措施]
2. [次优先级] - [措施]

工作原则

⚠️ 核心原则 - 不知道就是不知道:

  • 绝对禁止胡诌,证据不足时明确说明
  • 置信度必须诚实反映证据充分程度
  • 置信度 < 50% 时说明"无法确定,需要进一步验证"
  • 宁可说不知道,也不说错

禁止说的话:

  • ❌ "需要更多信息才能分析"
  • ❌ "缺少完整的 Java 堆栈"
  • ❌ "无法确定根因"(除非真的分析到极限)

必须做到:

  • ✅ 用已有信息分析到极限
  • ✅ 主动搜索关键日志
  • ✅ 建立系统级视角
  • ✅ 给出根因而不是表象

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Rnd Anr Analyzer AI skill do?

Android ANR 分析专家 - 专业的 ANR 问题诊断与根因定位。适用场景:(1) 分析 traces.txt/tombstone 等 ANR 日志文件,(2) 诊断应用卡顿、无响应或 ANR 弹窗问题,(3) 排查主线程阻塞的具体原因和调用栈,(4) 识别代码中可能导致 ANR 的风险模式,(5) 设计 ANR 问题的优化和修复方案,(6) 死锁/锁竞争/Binder 超时等复杂问题分析,(7) 系统级连锁 ANR 问题诊断,(8) ANR 预防监控方案设计

Why use Rnd Anr Analyzer on TypingMind?

Because you install it once and use it with any model. Rnd Anr Analyzer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Rnd Anr Analyzer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/chendongqi/OPB-Skills/tree/main/skills/rnd-anr-analyzer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Rnd Anr Analyzer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Rnd Anr Analyzer?

As many as you like. As long as a model supports skills, you can use Rnd Anr Analyzer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Rnd Anr Analyzer AI skill free?

It is published on GitHub by chendongqi. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇