LogcatReceiver
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 級別時附加 uid 格式 >24. |
InputStreamSource
|
getLogcatData(int maxBytes, int offset)
傳回有偏移值目前的 logcat 緩衝區。 |
InputStreamSource
|
getLogcatData(int maxBytes)
|
InputStreamSource
|
getLogcatData()
|
void
|
start()
|
void
|
stop()
|
公用建構函式
LogcatReceiver
public LogcatReceiver (ITestDevice device, String logcatCmd, long maxFileSize, int logStartDelay)
使用任何指定的 logcat 指令建立執行個體
| 參數 | |
|---|---|
device |
ITestDevice:要啟動 Logcat 的裝置 |
logcatCmd |
String:要執行的 logcat 指令 (包含「logcat」部分),請參閱
Logcat 說明訊息中的可用選項 |
maxFileSize |
long:檔案大小上限,達到大小上限時,系統會捨棄較早的行 |
logStartDelay |
int:裝置連線後等待的延遲時間 |
LogcatReceiver
public LogcatReceiver (ITestDevice device, long maxFileSize, int logStartDelay)
以預設 logcat「threadtime」建立執行個體格式
| 參數 | |
|---|---|
device |
ITestDevice:要啟動 Logcat 的裝置 |
maxFileSize |
long:檔案大小上限,達到大小上限時,系統會捨棄較早的行 |
logStartDelay |
int:裝置連線後等待的延遲時間 |
公用方法
清除
public void clear ()
getDefaultLogcatCmd
public static String getDefaultLogcatCmd (ITestDevice device)
取得預設 logcat 指令,僅在 API 級別時附加 uid 格式 >24.
| 參數 | |
|---|---|
device |
ITestDevice |
| 傳回 | |
|---|---|
String |
|
getLogcatData
public InputStreamSource getLogcatData (int maxBytes, int offset)
傳回有偏移值目前的 logcat 緩衝區。
| 參數 | |
|---|---|
maxBytes |
int:傳回的緩衝區大小上限 |
offset |
int:完整緩衝區的偏移值。 |
| 傳回 | |
|---|---|
InputStreamSource |
從偏移位置開始的 Logcat 緩衝區。 |
getLogcatData
public InputStreamSource getLogcatData (int maxBytes)
| 參數 | |
|---|---|
maxBytes |
int |
| 傳回 | |
|---|---|
InputStreamSource |
|
start
public void start ()
轉機 1 次
public void stop ()