Skip to content

hamsterjiang23/LldbAndroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

LldbAndroid

LldbAndroid is an agent skill for debugging and tracing Android native code with LLDB. It is designed for APKs, JNI libraries, Android .so files, Unity Android native libraries, and cross-platform Android remote debugging.

The primary entrypoint is a Python 3 CLI:

python scripts/android_lldb.py <subcommand> [options]

What This Skill Provides

  • Cross-platform orchestration for Windows, Linux, and macOS hosts.
  • Android remote debugging through adb, Android NDK lldb-server, host LLDB, and adb forward.
  • Session state, generated LLDB command files, JSONL trace logs, and safe cleanup.
  • Two LLDB Python control layers:
    • API mode when the host Python can import lldb.
    • CLI embedded Python fallback when only the lldb executable can run Python.
  • Optional uv helper command for creating a Python venv and trying to expose NDK LLDB Python bindings.
  • Legacy PowerShell and Bash scripts kept for compatibility and field reproduction.

Requirements

  • Python 3.
  • adb from Android SDK Platform Tools.
  • Android NDK containing lldb-server.
  • Host LLDB, usually from the same Android NDK toolchain.
  • A connected Android device or emulator with USB debugging enabled.
  • A debuggable target APK for run-as based workflows.
  • Optional: uv, if you want to try a dedicated Python environment for external import lldb.

Main Commands

python scripts/android_lldb.py capabilities
python scripts/android_lldb.py python-env --ndk /path/to/android-ndk
python scripts/android_lldb.py check --package com.example.app
python scripts/android_lldb.py prepare --package com.example.app --port 5039
python scripts/android_lldb.py attach --package com.example.app --port 5039 --mode auto
python scripts/android_lldb.py trace --package com.example.app --breakpoint target_trace_point --output trace.jsonl
python scripts/android_lldb.py stop

uv Boundary

python-env can create a uv venv, link Android NDK LLDB Python paths through a .pth file, and validate:

python -c "import lldb"

This helps when external LLDB SB API mode is possible, but it does not replace native LLDB or liblldb. If validation fails, continue with --mode auto or --mode cli; CLI fallback runs Python inside the lldb executable through the embedded interpreter.

Documentation

Install As a Skill

For Codex, place this directory under:

$CODEX_HOME/skills/LldbAndroid

For Claude Code, place this directory under:

$CLAUDE_HOME/skills/LldbAndroid

For Cursor, reference this repository from project rules; Cursor does not have a Codex/Claude-style global skill runtime.

About

LldbAndroid Agent Skill

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages