Add logcat APIs.

Bug: None
Test: Using this in the NDK
Change-Id: I8becab8a0697f2378f1ce472091be497ba13c848
This commit is contained in:
Dan Albert
2022-10-20 17:03:10 -07:00
parent c3f6fcabf1
commit 034e7e2827

View File

@@ -522,3 +522,11 @@ class AndroidDevice(object):
def set_prop(self, prop_name, value):
self.shell(['setprop', prop_name, value])
def logcat(self) -> str:
"""Returns the contents of logcat."""
return self._simple_call(['logcat', '-d'])
def clear_logcat(self) -> None:
"""Clears the logcat buffer."""
self._simple_call(['logcat', '-c'])