← 返回
开发者工具 中文

Pywayne Adb Logcat Reader

Read Android device logs in real-time via adb logcat using a C++ or Python backend with generator-style streaming output.
通过 adb logcat 实时读取 Android 设备日志,后端采用 C++ 或 Python 并支持生成器式流输出。
wangyendt
开发者工具 clawhub v0.1.0 1 版本 99769.3 Key: 无需
★ 0
Stars
📥 865
下载
💾 36
安装
1
版本
#latest

概述

Pywayne ADB Logcat Reader

This module provides real-time Android device log reading capabilities via the adb logcat command.

Quick Start

from pywayne.adb.logcat_reader import AdbLogcatReader

# Create reader (default C++ backend)
reader = AdbLogcatReader()

# Start log capture and read
reader.start()
for line in reader.read():
    print(line)

Use Python backend (alternative)

reader = AdbLogcatReader(backend='python')

reader.start()

for line in reader.read():

print(line)


# Stop and cleanup
reader.stop()

Initialization

# C++ backend (default, faster)
reader = AdbLogcatReader()

# Python backend (alternative, may be more compatible)
reader = AdbLogcatReader(backend='python')

Reading Logs

The read() method yields log lines incrementally as a generator, suitable for processing large logs or real-time monitoring.

# Process logs as they arrive
for line in reader.read():
    # Filter, parse, store...

Properties

PropertyDescription
----------------------
backend'cpp' or 'python'Active backend for adb logcat
runningWhether logcat process is running

Methods

MethodDescription
----------------------
start()Start adb logcat process
read()Generator yielding log lines
stop()Stop logcat process
get_backend()Get active backend type

Backends

C++ Backend (Default)

  • Uses native C++ implementation
  • Faster performance for real-time streaming
  • Better compatibility with adb logcat

Python Backend (Alternative)

  • Uses Python subprocess to call adb
  • More compatible across different environments
  • Easier debugging and integration

Notes

  • C++ backend is faster and recommended for production
  • Python backend may be useful during development
  • stop() terminates adb logcat; use Ctrl+C to send interrupt signal
  • Logs are cleared automatically when process stops

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-29 08:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,146
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,163
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,795