| name | android-kdebug |
| description | Use the android-kdebug skill when debugging Android apps over ADB. The android-kdebug skill documents using kdebug Frida CLI, the kdebug LLDB CLI, or common adb commands. |
Android Kdebug
Use this skill when the task is to debug an Android app on an ADB-visible device with kdebug.
Rules
- Prefer
kdebug for Frida workflows.
- Prefer
kdebug lldb ... for native attach workflows.
- Prefer plain
adb for shell, file transfer, install, and logcat tasks.
- Pass an explicit target device each time with
--device <serial-or-host:port> unless the user gave a different command form.
- Do not invent Frida session IDs or script IDs. List sessions or scripts first when needed.
- Do not invent LLDB session IDs. List LLDB sessions first when needed.
Frida workflows
List visible apps:
kdebug --device <target> frida apps
Attach to a running app:
kdebug --device <target> frida attach <package>
Spawn suspended and resume later:
kdebug --device <target> frida spawn <package>
kdebug --device <target> frida resume <session-id>
Inspect active state:
kdebug --device <target> frida sessions
kdebug --device <target> frida scripts
Load a persistent script:
kdebug --device <target> frida load-script <session-id> --name <name> --file hook.js
kdebug --device <target> frida load-script <session-id> --name <name> --source 'rpc.exports = { ping() { return "ok"; } };'
printf '%s\n' 'send("hello")' | kdebug --device <target> frida load-script <session-id> --name stdin-hook --stdin
Run a one-shot script or call RPC exports:
kdebug --device <target> frida eval <session-id> --file probe.js
kdebug --device <target> frida rpc <script-id> <method> [args...]
kdebug --device <target> frida messages <script-id>
Detach and clean up:
kdebug --device <target> frida unload-script <script-id>
kdebug --device <target> frida detach <session-id>
Use --json when the output needs to be consumed by another tool.
LLDB workflows
Attach by package or PID:
kdebug --device <target> lldb attach-package <package>
kdebug --device <target> lldb attach-pid <pid>
Inspect active LLDB sessions:
kdebug --device <target> lldb sessions
Print the host LLDB command to connect:
kdebug --device <target> lldb connect <session-id>
kdebug --device <target> lldb connect <session-id> --binary <host-binary>
kdebug --device <target> lldb connect <session-id> --binary <host-binary> --sysroot <sysroot>
Stop an LLDB session and remove its port forward:
kdebug --device <target> lldb stop <session-id>
Notes:
- v1 is attach-only; it does not start Android apps under LLDB control.
kdebug manages lldb-server on the device but does not launch host lldb automatically.
- Bundled binaries are expected under
kdebug/assets/lldb-server/<abi>/lldb-server.
- LLDB attach assumes a root-capable debugging environment.
Daemon behavior
Frida and LLDB commands auto-start one local kdebug daemon for all targets. Explicit daemon commands are only for inspection or cleanup:
kdebug daemon status
kdebug daemon start
kdebug daemon stop
The daemon holds target-scoped Frida sessions, scripts, and LLDB sessions in memory. If it stops, those sessions are gone and must be recreated.
Use adb for non-Frida tasks
Run shell commands:
adb -s <target> shell <command>
adb -s <target> shell su root sh -c '<command>'
Copy files:
adb -s <target> push <local-path> <remote-path>
adb -s <target> pull <remote-path> <local-path>
Read or write text files:
adb -s <target> shell cat <remote-path>
adb -s <target> shell 'printf %s "content" > <remote-path>'
adb -s <target> shell 'cat > <remote-path>' < local-file
Install apps:
adb -s <target> install <app.apk>
adb -s <target> install-multiple <base.apk> <split.apk>
Inspect logs:
adb -s <target> logcat
adb -s <target> logcat --pid <pid>