6from __future__
import print_function
13 def __init__(self, device_serial=None, adb_binary=None, echo=False):
30 result = subprocess.check_output(self.
__invocation + [
'shell', cmd], encoding=
'utf-8')
32 print(result, file=sys.stderr)
55 def __echo_shell_cmd(self, cmd):
56 escaped = [re.sub(
r'([^a-zA-Z0-9])',
r'\\\1', x)
57 for x
in cmd.strip().splitlines()]
58 self.
__invoke(
'shell',
'echo',
'$(whoami)@$(getprop ro.serialno)$',
59 " '\n>' ".
join(escaped))
61 def __invoke(self, *args):
63 subprocess.call(self.
__invocation + list(args), stdout=sys.stderr)
65 def __establish_connection(self):
72 if '1' == self.
check(
'getprop sys.boot_completed').strip():
def print(*args, **kwargs)
static SkString join(const CommandLineFlags::StringArray &)