patilshreyas/debroid/debroid-cli
Claude Code and agent skill by patilshreyas/debroid
- community
Checking that the SKILL.md file is still in the repository.
Orchestrate headless Android debugging via JDWP. ACTIVATE this skill whenever asked to debug an Android application, set line or exception breakpoints, inspect runtime variables or Jetpack Compose state, step through execution, evaluate live expressions, watch fields, or diagnose runtime crashes.
Install
npx vskill@latest install patilshreyas/debroid/debroid-cliSKILL.md
Debroid CLI Debugger Skill
This skill provides mandatory instructions for AI agents to use the debroid CLI for headless Android debugging. Follow these instructions strictly to avoid context window bloat and execution errors.
🎯 Trigger Conditions
Activate this skill whenever the user or task involves:
- Debugging an Android application or process live
- Setting line breakpoints in Kotlin or Java source files (
debroid break) - Catching uncaught or caught runtime exceptions (
debroid catch-exception) - Inspecting live variables, object memory, or Jetpack Compose state (
debroid locals,pause-state,inspect) - Stepping through Kotlin/Java code execution (
debroid step) - Monitoring field access or modifications with watchpoints (
debroid watch) - Evaluating expressions or mutating variable values in runtime memory (
debroid eval,set-var)
⚠️ Critical Agent Rules (DO NOT IGNORE)
- Always use `--with-stacktrace` when polling to get immediate context.
- Never poll in an infinite loop. Poll once or twice, and if the app hasn't hit a breakpoint, instruct the user to interact with the app.
- Parse JSON outputs carefully. All CLI outputs are JSON strings. Extract
sessionId,threadId,objectId,breakpointId,exceptionBreakpointId,watchpointId, andcontinuationIdexactly as provided and reuse them verbatim in subsequent commands. Do not synthesize IDs. - Track trap IDs and remove them when done. Every
break,catch-exception, andwatchreturns an ID. Useremove-break,remove-catch-exception,remove-watchto clear traps you no longer need so they don't fire unexpectedly and waste poll cycles. - Keep IDs in working memory, not in long scratch buffers. A typical session uses 1–3 trap IDs plus 1 thread ID — keep them inline.
- Use Background Tasks: If you are using an agentic system that supports background tasks, run
debroid daemonas a background task. - Token efficiency & Schema Inspection: All JSON responses are compact single-line by default to conserve agent context tokens. If formatted multi-line JSON is required, append the
--prettyflag to any JSON command. To inspect the expected output JSON structure for any command without running a session, pass the--schemaflag (e.g.,debroid pause-state --schema). Do not echo full responses back to the user verbatim — summarize the relevant fields (valuePreview,type,objectId,location). - Self-Recovery: If a session becomes unresponsive or gets out of sync, run
debroid stopto cleanly terminate the daemon and release ADB ports. The nextdebroidcommand will auto-restart a fresh daemon. - Report, but don't block: If you hit unexpected Debroid behavior or have feedback on the tool itself, first try to resume the flow of what the user originally wanted to perform. Do not immediately jump to reporting the issue. At the end of your task, ask the user if they want to report the issue. See "🐛 Reporting Bugs & Feedback" below for details.
🔄 Standard Debugging Workflow
Step 1: Start the Daemon
Debroid requires a persistent background daemon to communicate with the Android device via JDWP.
(Wait 1-2 seconds for it to start). The first CLI command will also auto-start the daemon if it isn't running.
Step 2: Attach to the App
You must attach the debugger to obtain a sessionId.
- If the user wants to debug app startup:
``bash debroid launch <app_id> debroid break <session_id> <FileName.kt> <line_number> --package <pkg> debroid resume <session_id> ` > ⚠️ launch starts the app suspended via am set-debug-app -w and halts the VM with all threads suspended (suspendedThreadsCount > 0). Set your startup breakpoints or watchpoints immediately after launch, and then call debroid resume <session_id> so the VM proceeds with startup and hits your breakpoints. (Pass --no-suspend if you want the app to start executing immediately upon launch without waiting). > ⚠️ launch uses am set-debug-app -w. Debroid **automatically** clears this flag when you call detach, so the next normal (non-debug) launch of the app will not hang. Do not call am clear-debug-app` yourself.
- If the app is already running:
``bash debroid attach <app_id> ` *(Pass --suspend if you want to suspend all threads immediately upon attaching).* **Action:** Extract the sessionId` from the JSON response.
⚠️ Session Lifecycle & Breakpoints (Crucial!):Breakpoints, watchpoints, and exception traps are strictly session-scoped. When you callattachorlaunchfor anapp_idthat is already being debugged by an older/stale session, Debroid's automatic deduping will instantly safely detach that stale session. This completely wipes all breakpoints and watchpoints you may have set previously. You MUST recreate any breakpoints or watchpoints you need using your newsessionIdreturned by the newattach/launchcommand!
Step 3: Set Traps
Set your breakpoints or watchpoints before polling. Save the returned IDs.
- Line Breakpoint:
debroid break <session_id> <FileName.kt> <line_number> [--package <pkg>] [--pretty]→ returns{ "id": "bp_1", "verified": true|false, ... } - Always pass `--package` when you know it (e.g.
--package com.example.app.search). Providing the package name lets the daemon resolve the class with a single targeted lookup instead of scanning every loaded class across the entire VM, which takes seconds or minutes on large applications and drastically improves responsiveness. - If
verified=false, the class isn't loaded yet. Debroid will automatically bind it the moment the class is prepared — you do not need to do anything; just poll. (No more deferred-breakpoint dead-ends.) - Use
remove-break <session_id> <breakpoint_id>to clear it. - Exception Trap:
debroid catch-exception <session_id> [ExceptionClass] [--caught] [--uncaught] - Defaults:
--uncaughtON,--caughtOFF. Add--caughtto also trap exceptions caught by the app. - Returns
{ "exceptionBreakpointId": "ex_bp_1" }. - Remove with
remove-catch-exception <session_id> <exception_breakpoint_id>. - Watchpoint:
debroid watch <session_id> <com.pkg.Class> <fieldName> [--access] [--modify] - Defaults: BOTH access and modify ON. Pass
--no-accessor--no-modifyto disable either. - Returns
{ "watchpointId": "wp_1" }(or anINVALID_ARGUMENTerror if the target class is already loaded and<fieldName>does not exist on it). - Remove with
remove-watch <session_id> <watchpoint_id>.
Step 4: Poll for Events
You must poll the event queue to see if a trap was triggered.
- Initial Cursor: Always start with
"0". - Subsequent Cursors: Use the
nextCursorvalue from the previous JSON response. - Buffer Overflow & Stale Cursors: Inspect
droppedEventsSinceLastPoll(omitted from JSON when 0). If present and > 0, events were evicted from the buffer before they could be polled (e.g. due to high event volume or delayed polling). If an expected breakpoint or exception event is not present inevents, it may have been among the dropped events. - Waiting: If
eventsis empty, ask the user to trigger the action in the app, then poll again. - Event types you may see:
BREAKPOINT_HIT(includesbreakpointId),STEP_HIT,EXCEPTION_HIT(exceptionMessageincludes<ExceptionClass>: <detailMessage>),WATCHPOINT_ACCESS_HIT(includesstacktracewhen--with-stacktraceis set),WATCHPOINT_MODIFY_HIT(includesstacktracewhen--with-stacktraceis set),DISCONNECT.
Step 5: Inspect the Pause State
Once poll returns an event (e.g., BREAKPOINT_HIT), extract the threadId. Use the Pause State Command to get frames and locals at once:
Advanced Inspections:
- Drill into complex objects or arrays:
debroid inspect <session_id> <object_id> [OPTIONS] --max-depth Nrecurses N levels deep into object fields and array elements. Responses include anestedmap keyed by field name (or array index"[0]","[1]", ...). Cycles are guarded automatically.- Array Inspection: Inspecting an array
objectId(or a collection's backing array) populatesfields(andnestedwhen--max-depth > 1) with indexed keys ("[0]","[1]", ...). - Important Filter Behavior: By default,
inspectexplicitly filters outstaticfields,syntheticfields, and ART-specific internal fields (shadow$_*). It also prevents redundant recursion into well-known immutable terminal types (likejava.lang.Stringand Enums) to save your context tokens. --include-staticand--include-internalcan be passed to bypass these filters if you absolutely need to inspect Dalvik internals or static class constants.- Coroutine state:
debroid coroutine <session_id> <continuation_id>
ObjectId Lifecycle & Reuse (Crucial!):AnyobjectIdorcontinuation_idreturned by ANY command (includinglocals,pause-state,pollstacktraces,eval, or even inside a deeply nestedinspectresult) is globally cached by the daemon and guaranteed to remain valid and reusable across multiple standalone commands for the entire duration of the current suspend. You can confidently extract nestedobjectIds from a shallow inspect and drill into them later. These IDs are only invalidated/cleared when the VM is explicitly resumed (e.g. viastep,resume) or detached.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/debroid-cli/SKILL.md
Popularity
- Repository stars
- 276
- Repository forks
- 14
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/patilshreyas/debroid/debroid-cli)