Flutter Engine
The Flutter Engine
Functions | Variables
setup_device_for_asan Namespace Reference

Functions

def wait_for_device ()
 
def installASAN (revert=False)
 

Variables

 ADB = sys.argv[1]
 
 ASAN_SETUP = sys.argv[2]
 
 log = subprocess.check_output([ADB, 'root']).decode('utf-8')
 
 output = subprocess.check_output([ADB, 'disable-verity']).decode('utf-8')
 
 revert
 

Function Documentation

◆ installASAN()

def setup_device_for_asan.installASAN (   revert = False)

Definition at line 41 of file setup_device_for_asan.py.

41def installASAN(revert=False):
42 # ASAN setup script is idempotent, either it installs it or
43 # says it's installed. Returns True on success, false otherwise.
44 out = subprocess.check_output([ADB, 'wait-for-device']).decode('utf-8')
45 print(out)
46 cmd = [ASAN_SETUP]
47 if revert:
48 cmd = [ASAN_SETUP, '--revert']
49 process = subprocess.Popen(cmd, env={'ADB': ADB},
50 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
51
52 # this also blocks until command finishes
53 (stdout, stderr) = process.communicate()
54 print(stdout.decode('utf-8'))
55 print('Stderr: %s' % stderr.decode('utf-8'))
56 return process.returncode == 0
57
def print(*args, **kwargs)
Definition: run_tests.py:49
def installASAN(revert=False)
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124

◆ wait_for_device()

def setup_device_for_asan.wait_for_device ( )

Definition at line 14 of file setup_device_for_asan.py.

14def wait_for_device():
15 while True:
16 time.sleep(5)
17 print('Waiting for device')
18 subprocess.check_call([ADB, 'wait-for-device'])
19 bit1 = subprocess.check_output([ADB, 'shell', 'getprop',
20 'dev.bootcomplete']).decode('utf-8')
21 bit2 = subprocess.check_output([ADB, 'shell', 'getprop',
22 'sys.boot_completed']).decode('utf-8')
23 if '1' in bit1 and '1' in bit2:
24 print('Device detected')
25 break
26

Variable Documentation

◆ ADB

setup_device_for_asan.ADB = sys.argv[1]

Definition at line 11 of file setup_device_for_asan.py.

◆ ASAN_SETUP

setup_device_for_asan.ASAN_SETUP = sys.argv[2]

Definition at line 12 of file setup_device_for_asan.py.

◆ log

setup_device_for_asan.log = subprocess.check_output([ADB, 'root']).decode('utf-8')

Definition at line 27 of file setup_device_for_asan.py.

◆ output

setup_device_for_asan.output = subprocess.check_output([ADB, 'disable-verity']).decode('utf-8')

Definition at line 33 of file setup_device_for_asan.py.

◆ revert

setup_device_for_asan.revert

Definition at line 62 of file setup_device_for_asan.py.