Commit 0d7e90d5 authored by Ian Fischer's avatar Ian Fischer

Make it possible to download trace files on rooted devices using sky_tool stop_trace

parent 99356d10
......@@ -952,6 +952,16 @@ class StopTracing(object):
logging.info('Downloading trace %s ...' % os.path.basename(device_path))
if device_path:
cmd = [ADB_PATH, 'root']
logging.info(' '.join(cmd))
output = subprocess.check_output(cmd)
match = re.match(r'.*cannot run as root.*', output
if match is not None:
logging.error('Unable to download trace file %s\n'
'You need to be able to run adb as root '
'on your android device' % device_path)
return 2
cmd = [ADB_PATH, 'pull', device_path]
logging.info(' '.join(cmd))
subprocess.check_output(cmd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment