自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ILogcatReceiver
public
interface
ILogcatReceiver
com.android.tradefed.device.ILogcatReceiver
|
一个类,用于将设备的 Logcat 输出作为 InputStreamSource
提供。
摘要
公共方法
清除
public abstract void clear ()
getLogcatData
public InputStreamSource getLogcatData (int maxBytes,
int offset)
给定偏移量,返回当前的 Logcat 缓冲区。
参数 |
maxBytes |
int :返回缓冲区的大小上限 |
offset |
int :完整缓冲区的偏移量。 |
start
public abstract void start ()
停止
public abstract void stop ()
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# ILogcatReceiver\n===============\n\n\n`\npublic\n\n\ninterface\nILogcatReceiver\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------|\n| com.android.tradefed.device.ILogcatReceiver |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [LogcatReceiver](../../../../../../reference/tradefed/com/android/tradefed/device/LogcatReceiver.html) |--------------------------------------------------------------------------------------------------------|-------------------------------------------| | [LogcatReceiver](../../../../../../reference/tradefed/com/android/tradefed/device/LogcatReceiver.html) | Class that collects logcat in background. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA class that provides the output of a device's logcat as an [InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html).\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[clear](../../../../../../reference/tradefed/com/android/tradefed/device/ILogcatReceiver.html#clear())`() ` |\n| ` default `[InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | ` `[getLogcatData](../../../../../../reference/tradefed/com/android/tradefed/device/ILogcatReceiver.html#getLogcatData(int,%20int))`(int maxBytes, int offset) ` Returns the current logcat buffer given an offset. |\n| ` abstract `[InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | ` `[getLogcatData](../../../../../../reference/tradefed/com/android/tradefed/device/ILogcatReceiver.html#getLogcatData(int))`(int maxBytes) ` |\n| ` abstract `[InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | ` `[getLogcatData](../../../../../../reference/tradefed/com/android/tradefed/device/ILogcatReceiver.html#getLogcatData())`() ` |\n| ` abstract void` | ` `[start](../../../../../../reference/tradefed/com/android/tradefed/device/ILogcatReceiver.html#start())`() ` |\n| ` abstract void` | ` `[stop](../../../../../../reference/tradefed/com/android/tradefed/device/ILogcatReceiver.html#stop())`() ` |\n\nPublic methods\n--------------\n\n### clear\n\n```\npublic abstract void clear ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### getLogcatData\n\n```\npublic InputStreamSource getLogcatData (int maxBytes, \n int offset)\n```\n\nReturns the current logcat buffer given an offset.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|---------------------------------------------------|\n| `maxBytes` | `int`: The max size of the returned buffer \u003cbr /\u003e |\n| `offset` | `int`: The offset of the full buffer. \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| [InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | The logcat buffer starting at the offset. \u003cbr /\u003e |\n\n### getLogcatData\n\n```\npublic abstract InputStreamSource getLogcatData (int maxBytes)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------|\n| `maxBytes` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | \u003cbr /\u003e |\n\n### getLogcatData\n\n```\npublic abstract InputStreamSource getLogcatData ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------|\n| [InputStreamSource](../../../../../../reference/tradefed/com/android/tradefed/result/InputStreamSource.html) | \u003cbr /\u003e |\n\n### start\n\n```\npublic abstract void start ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### stop\n\n```\npublic abstract void stop ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]