Logcat接收器

public class LogcatReceiver
extends Object implements ILogcatReceiver

java.lang.Object
com.android.tradefed.device.LogcatReceiver


在背景收集 logcat 的類別。即使設備離線然後又上線,也會繼續捕獲 logcat。

概括

公共構造函數

LogcatReceiver ( ITestDevice device, String logcatCmd, long maxFileSize, int logStartDelay)

使用任何指定的 logcat 命令建立實例

LogcatReceiver ( ITestDevice device, long maxFileSize, int logStartDelay)

使用預設 logcat 'threadtime' 格式建立一個實例

公共方法

void clear ()
static String getDefaultLogcatCmd ( ITestDevice device)

取得預設的 logcat 指令,僅在 api 等級 > 24 時附加 uid 格式。

InputStreamSource getLogcatData (int maxBytes, int offset)

傳回給定偏移量的目前 logcat 緩衝區。

InputStreamSource getLogcatData (int maxBytes)
InputStreamSource getLogcatData ()
void start ()
void stop ()

公共構造函數

Logcat接收器

public LogcatReceiver (ITestDevice device, 
                String logcatCmd, 
                long maxFileSize, 
                int logStartDelay)

使用任何指定的 logcat 命令建立實例

參數
device ITestDevice :啟動 logcat 的設備

logcatCmd String :要執行的 logcat 命令(包括「logcat」部分),請參閱 logcat 說明訊息中有關可用選項的詳細信息

maxFileSize long :最大檔案大小,一旦達到大小,前面的行將被丟棄

logStartDelay int : 設備上線後等待的延遲時間

Logcat接收器

public LogcatReceiver (ITestDevice device, 
                long maxFileSize, 
                int logStartDelay)

使用預設 logcat 'threadtime' 格式建立一個實例

參數
device ITestDevice :啟動 logcat 的設備

maxFileSize long :最大檔案大小,一旦達到大小,前面的行將被丟棄

logStartDelay int : 設備上線後等待的延遲時間

公共方法

清除

public void clear ()

取得預設LogcatCmd

public static String getDefaultLogcatCmd (ITestDevice device)

取得預設的 logcat 指令,僅在 api 等級 > 24 時附加 uid 格式。

參數
device ITestDevice

退貨
String

取得Logcat數據

public InputStreamSource getLogcatData (int maxBytes, 
                int offset)

傳回給定偏移量的目前 logcat 緩衝區。

參數
maxBytes int : 傳回緩衝區的最大大小

offset int :完整緩衝區的偏移量。

退貨
InputStreamSource logcat 緩衝區從偏移量開始。

取得Logcat數據

public InputStreamSource getLogcatData (int maxBytes)

參數
maxBytes int

退貨
InputStreamSource

取得Logcat數據

public InputStreamSource getLogcatData ()

退貨
InputStreamSource

開始

public void start ()

停止

public void stop ()