自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
ILogcatReceiver
public
interface
ILogcatReceiver
com.android.tradefed.device.ILogcatReceiver
|
這個類別會以 InputStreamSource
的形式提供裝置 Logcat 的輸出內容。
摘要
公用方法
清除
public abstract void clear ()
getLogcatData
public InputStreamSource getLogcatData (int maxBytes,
int offset)
在指定偏移量時,傳回目前的 Logcat 緩衝區。
參數 |
maxBytes |
int :傳回緩衝區的最大大小 |
offset |
int :完整緩衝區的偏移量。 |
start
public abstract void start ()
轉機 1 次
public abstract void stop ()
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間: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"]]