Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
tools.skpbench._adb.Adb Class Reference

Public Member Functions

def __init__ (self, device_serial=None, adb_binary=None, echo=False)
 
def shell (self, cmd)
 
def check (self, cmd)
 
def root (self)
 
def is_root (self)
 
def remount (self)
 
def reboot (self)
 

Detailed Description

Definition at line 12 of file _adb.py.

Constructor & Destructor Documentation

◆ __init__()

def tools.skpbench._adb.Adb.__init__ (   self,
  device_serial = None,
  adb_binary = None,
  echo = False 
)

Definition at line 13 of file _adb.py.

13 def __init__(self, device_serial=None, adb_binary=None, echo=False):
14 self.__invocation = [adb_binary]
15 if device_serial:
16 self.__invocation.extend(['-s', device_serial])
17 self.__echo = echo
18 self.__is_root = None
19 self.__has_established_connection = False
20

Member Function Documentation

◆ check()

def tools.skpbench._adb.Adb.check (   self,
  cmd 
)

Definition at line 26 of file _adb.py.

26 def check(self, cmd):
27 if self.__echo:
28 self.__echo_shell_cmd(cmd)
29 self.__establish_connection()
30 result = subprocess.check_output(self.__invocation + ['shell', cmd], encoding='utf-8')
31 if self.__echo:
32 print(result, file=sys.stderr)
33 return result
34
#define check(reporter, ref, unref, make, kill)
Definition: RefCntTest.cpp:85
def print(*args, **kwargs)
Definition: run_tests.py:49

◆ is_root()

def tools.skpbench._adb.Adb.is_root (   self)

Definition at line 42 of file _adb.py.

42 def is_root(self):
43 if self.__is_root is None:
44 self.__is_root = ('root' == self.check('whoami').strip())
45 return self.__is_root
46

◆ reboot()

def tools.skpbench._adb.Adb.reboot (   self)

Definition at line 50 of file _adb.py.

50 def reboot(self):
51 self.__is_root = None
52 self.shell('reboot')
53 self.__has_established_connection = False
54

◆ remount()

def tools.skpbench._adb.Adb.remount (   self)

Definition at line 47 of file _adb.py.

47 def remount(self):
48 self.__invoke('remount')
49

◆ root()

def tools.skpbench._adb.Adb.root (   self)

Definition at line 35 of file _adb.py.

35 def root(self):
36 if not self.is_root():
37 self.__invoke('root')
38 self.__has_established_connection = False
39 self.__is_root = None
40 return self.is_root()
41
string root
Definition: scale_cpu.py:20

◆ shell()

def tools.skpbench._adb.Adb.shell (   self,
  cmd 
)

Definition at line 21 of file _adb.py.

21 def shell(self, cmd):
22 if self.__echo:
23 self.__echo_shell_cmd(cmd)
24 self.__invoke('shell', cmd)
25

The documentation for this class was generated from the following file: