android-profiler

Records and analyzes Android Perfetto traces, heap dumps, and CPU profiles to diagnose performance issues.

2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/skills --skill android-profiler-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-profiler
Source: https://github.com/IsKenKenYa/skills/tree/main/skills/android/profilers/android-profiler
Command: npx skills add https://github.com/IsKenKenYa/skills --skill android-profiler-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Diagnosing Android performance problems like jank, slow app startup, memory leaks, and battery drain requires deep expertise in trace recording and PerfettoSQL analysis. This Skill orchestrates the entire profiling workflow, from capturing the right data on a device to running structured root-cause analysis on the resulting traces. ## Core Features & Use Cases - Trace Recording: Records system traces, Java heap dumps, native heap profiles, and CPU callstack samples on Android devices using official Perfetto helper scripts, with support for custom multi-source trace configs. - Guided Trace Analysis: Runs a system-wide triage, then spawns parallel subagent investigations per candidate thread to trace dependency chains down to terminal root causes, backed by expert hints for CPU, graphics, I/O, IPC, memory, and power subsystems. - Ad-hoc PerfettoSQL Querying: Drafts, debugs, and executes PerfettoSQL queries against trace files using trace_processor sessions, following schema validation and standard library best practices. - Use Case: A user reports dropped frames in their app. The Skill records a system trace with frame timeline data, triages the trace to find the worst janky frame, investigates the main and render threads across process boundaries, and produces a report classifying the root cause with SQL-backed evidence. ## Quick Start Ask the assistant to record a Perfetto system trace of your app and analyze it to find the root cause of the jank you are seeing.

Frequently Asked Questions about android-profiler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I record a Perfetto system trace on Android?

Use the official Perfetto helper scripts such as record_android_trace with your device connected via USB and USB debugging enabled. For example, run record_android_trace with a duration, buffer size, and categories like sched, gfx, and wm to capture scheduling and graphics events.

How do I analyze a Perfetto trace to find the cause of Android jank?

Load the trace into a trace_processor session and run a system-wide triage using metrics like android_cpu and android_surfaceflinger to identify candidate janky frames. Then investigate the victim thread's state distribution and follow blocker dependency chains across threads and processes to reach the root cause.

How do I capture a Java heap dump on Android to investigate memory leaks?

Use the java_heap_dump helper script from the Perfetto tools repository with your app's package name to capture a snapshot of all Java objects. The resulting trace can be queried with PerfettoSQL heap graph modules to trace retainer paths back to GC roots.

Does Perfetto trace recording work on Linux, macOS, or Chrome?

The recording workflow in this Skill is strictly for Android devices connected via adb. For other platforms such as Linux, macOS, or Chrome, refer to the platform-specific documentation on perfetto.dev.

Why does my PerfettoSQL query fail or return wrong results?

Common causes include guessing column names instead of validating schemas with LIMIT 0 queries, joining on tid or pid instead of the unique utid or upid, and using LIKE instead of GLOB for string matching. Always verify table schemas and use standard library modules before writing custom joins.

What is the difference between heap dumps and native heap profiling on Android?

Java heap dumps capture a snapshot of all Java objects for retention analysis, while native heap profiling with heapprofd samples C/C++ malloc and free callstacks over time to find native leaks. Use java_heap_dump for Java leaks and heap_profile for native allocations.