LogcatReceiver

public class LogcatReceiver
extends Object implements ILogcatReceiver

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


คลาสที่รวบรวม Logcat ในเบื้องหลัง บันทึก Logcat ต่อไปแม้ว่าอุปกรณ์จะออฟไลน์แล้วออนไลน์ก็ตาม

สรุป

ตัวสร้างแบบสาธารณะ

LogcatReceiver(ITestDevice device, long maxFileSize, int logStartDelay)

สร้างอินสแตนซ์ที่มีรูปแบบ "threadtime" ของ Logcat เริ่มต้น

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

สร้างอินสแตนซ์ด้วยคำสั่ง logcat ที่ระบุ

เมธอดสาธารณะ

void clear()
static String getDefaultLogcatCmd(ITestDevice device)

รับคำสั่ง logcat เริ่มต้น ต่อท้ายรูปแบบ uid เท่านั้นหากระดับ API > 24

InputStreamSource getLogcatData(int maxBytes, int offset)

แสดงผลบัฟเฟอร์ logcat ปัจจุบันโดยให้ออฟเซ็ต

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

ตัวสร้างแบบสาธารณะ

LogcatReceiver

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

สร้างอินสแตนซ์ที่มีรูปแบบ "threadtime" ของ Logcat เริ่มต้น

พารามิเตอร์
device ITestDevice: อุปกรณ์ที่จะเริ่ม logcat

maxFileSize long: ขนาดไฟล์สูงสุด ระบบจะทิ้งบรรทัดก่อนหน้าเมื่อถึงขนาดที่กำหนด

logStartDelay int: ระยะเวลารอหลังจากที่อุปกรณ์ออนไลน์

ตัวรับ Logcat

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

สร้างอินสแตนซ์ด้วยคำสั่ง logcat ที่ระบุ

พารามิเตอร์
device ITestDevice: อุปกรณ์ที่จะเริ่มต้น Logcat

logcatCmd String: คำสั่ง logcat ที่จะเรียกใช้ (รวมถึงส่วน "logcat") ดูรายละเอียดเกี่ยวกับตัวเลือกที่ใช้ได้ในข้อความความช่วยเหลือของ logcat

maxFileSize long: ขนาดไฟล์สูงสุด ระบบจะทิ้งบรรทัดก่อนหน้าเมื่อถึงขนาดที่กำหนด

logStartDelay int: ระยะเวลารอหลังจากที่อุปกรณ์ออนไลน์

เมธอดสาธารณะ

ล้าง

public void clear ()

getDefaultLogcatCmd

public static String getDefaultLogcatCmd (ITestDevice device)

รับคําสั่ง logcat เริ่มต้น เพิ่มรูปแบบ uid ต่อท้ายเฉพาะในกรณีที่ระดับ API มากกว่า 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

getLogcatData

public InputStreamSource getLogcatData ()

คิกรีเทิร์น
InputStreamSource

เริ่มต้น

public void start ()

แวะพัก

public void stop ()