MCPInstall

frida-stalker-android

Trace native execution on Android with Frida Stalker (Frida 17+): call summaries, event parsing, transforms, and performance-safe start/stop patterns.

Installs
117
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/yfe404/frida-stalker-skills --skill frida-stalker-android
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads frida-stalker-android automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Frida Stalker (Android)

Overview

Use this skill when you need to trace native code execution on Android using Frida's Stalker API, with templates geared for ARM/ARM64 and performance-safe defaults.

This skill assumes Frida 17+ JavaScript semantics.

When To Use This Skill

  • User explicitly asks for "Frida Stalker" on Android.
  • You need to measure native call activity (who got called, how often) with low overhead.
  • You need ordered call events (call graph reconstruction) or coarse coverage.
  • You need to inject logic on basic-block compilation through transform(iterator).

Quick Decision Guide

  • Want call counts per target and don't care about ordering: use onCallSummary.
  • Want ordered call/ret/block/compile events: use onReceive and decode with Stalker.parse().
  • Want instruction-level matching and callouts: use transform(iterator) (heavy; do it narrowly).
  • Want to watch a small set of call targets: consider Stalker.addCallProbe().

Core API Facts (Frida 17+)

  • Stalker.follow([threadId, options])
  • Provide exactly one callback: onReceive(events) or onCallSummary(summary).
  • Stalker.unfollow([threadId])
  • Stalker.parse(events, { annotate, stringify })
  • Stalker.flush() drains buffered events early (otherwise periodic draining is controlled by Stalker.queueDrainInterval).
  • Stalker.garbageCollect() should be called after unfollow() to free accumulated memory at a safe point.
  • Stalker.exclude({ base, size }) excludes a memory range from stalking (useful to skip noisy/system modules).
  • Tuning:
  • Stalker.trustThreshold default 1 (set -1 for no trust, 0 to trust immediately, or N to trust after N executions).
  • Stalker.queueCapacity default 16384 events.
  • Stalker.queueDrainInterval default 250 ms (set 0 to disable periodic draining and call Stalker.flush() manually).

Workflow

  1. Define objective.
  2. Choose thread(s).
  3. Choose capture mode and filters.
  4. Pick a template and adapt it.
  5. Run, tune performance, and clean up.

If you are using the Frida MCP tools, also enable $frida-mcp-workflow and follow its phases (Idea -> Scripting -> Execution -> Notes).

Templates

Start from these and keep scripts file-based.

  • templates/stalker-call-summary.js: low-overhead call counting via onCallSummary.
  • templates/stalker-onreceive-parse.js: receive binary events and decode with Stalker.parse().
  • templates/stalker-start-stop-around-hook.js: follow/unfollow only during a specific hooked function call.
  • templates/stalker-call-probe.js: observe calls to a single target via Stalker.addCallProbe().
  • templates/stalker-transform-skeleton.js: minimal transform(iterator) skeleton with ARM/ARM64 safety check.
  • templates/stalker-filter-modules.js: helper to select "app modules" on Android and exclude the rest.

Quick Start

  1. If you do not know the thread id yet, start with templates/stalker-start-stop-around-hook.js.
  2. If you already know the thread id and want low overhead, use templates/stalker-call-summary.js.
  3. If you need ordered events, use templates/stalker-onreceive-parse.js and keep event types narrow.
  4. If you only care about calls to one target, start with templates/stalker-call-probe.js.

MCP Usage Notes (If Available)

When driving this through the Frida MCP tools, prefer this flow:

  1. Create or attach a session (mcp__frida__create_interactive_session / mcp__frida__attach_to_process).
  2. Load the selected template with mcp__frida__load_script.
  3. Start tracing through RPC exports using mcp__frida__call_rpc_export (templates expose start() / stop() when appropriate).
  4. Use mcp__frida__get_session_messages to consume output.

Keep a script ledger (what is loaded, purpose, and teardown path). This is enforced by $frida-mcp-workflow.

Android-Specific Notes (Practical)

  • Thread choice matters more than you think.

  • If you start stalking the wrong thread, you will see nothing, or only system noise.

  • A safe pattern is to start stalking from inside an Interceptor.attach() callback, using Process.getCurrentThreadId() to capture the thread that is actually executing your target function.

  • Module filtering is essential.

  • On Android, app code is usually in modules whose path contains /data/app/, /data/data/, or an extracted APK split path.

  • Exclude common noise sources (libart.so, libc.so, liblog.so, etc.) using Stalker.exclude() when you only care about your app's own native libs.

  • 32-bit ARM note.

  • If you use raw addresses on 32-bit ARM, Thumb functions require the low bit set. Prefer addresses returned by Frida APIs like Process.getModuleByName(...).getExportByName(...).

  • Avoid Process.runOnThread() unless you know what you're doing.

  • It can interrupt a thread in non-reentrant code and cause deadlocks/crashes.

Performance Rules Of Thumb

  • Avoid events.exec unless you truly need instruction-level traces. It produces huge volumes of data.
  • Prefer onCallSummary over onReceive when you can.
  • Keep your callbacks lean; push heavy work to the host side when possible.
  • Use Stalker.exclude() aggressively to reduce time spent in system libraries.
  • Prefer manual draining (Stalker.queueDrainInterval = 0 + Stalker.flush()) when you need deterministic windows.
  • Call Stalker.garbageCollect() after unfollowing, especially if you repeatedly start/stop.

Cleanup Checklist

  • Stalker.unfollow(threadId)
  • Stalker.flush()
  • Stalker.garbageCollect()

Troubleshooting

  • No output at all.

  • You are likely stalking the wrong thread, or your callback isn't being invoked (e.g., you followed a thread that never runs).

  • Output is only system noise.

  • Add module filters and exclusions. Start stalking from inside a hook where you know you're in app code.

  • Target slows to a crawl or dies.

  • Reduce enabled events, stop using exec, and switch to onCallSummary. Exclude large/noisy modules.

For deeper notes, see:

  • references/stalker-api.md
  • references/android-filtering.md

FAQ

What does the frida-stalker-android skill do?

Trace native execution on Android with Frida Stalker (Frida 17+): call summaries, event parsing, transforms, and performance-safe start/stop patterns.

How do I install frida-stalker-android?

Run npx skills add https://github.com/yfe404/frida-stalker-skills --skill frida-stalker-android in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/frida-stalker-android/ (personal) or .claude/skills/frida-stalker-android/ (project).

Which AI agents can use frida-stalker-android?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is frida-stalker-android safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains frida-stalker-android?

It is published by yfe404 in yfe404/frida-stalker-skills. It has 117 recorded installs.

Popular mobile skills

View category →

design-mobile-apps

designed-by-ai/skills

Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.

Mobile1.1M installs

ios-design

uizze.sh

Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.

Mobile416.5K installs

vercel-react-native-skills

vercel-labs/agent-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

OfficialMobile256.7K installs

animate-expo

emilkowalski/skills

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.

Mobile140.1K installs

xcode-project-setup

firebase/agent-skills

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

OfficialMobile131.2K installs

firebase-remote-config-basics

firebase/agent-skills

Manages Firebase Remote Config templates, feature flags, loading strategies, and SDKs (Android, iOS). Use when downloading/deploying remoteconfig JSON templates, managing version history/feature flags, setting in-app defaults, fetchAndActivate(), real-time listeners, or SDK setup. Don't use for Firebase Hosting, Auth, Firestore, Data Connect, Crashlytics, or App Hosting.

OfficialMobile121.7K installs