From 0d7e90d5902eb8e61cae14f08baf7a3fbb076184 Mon Sep 17 00:00:00 2001 From: Ian Fischer Date: Mon, 31 Aug 2015 17:12:09 -0700 Subject: [PATCH] Make it possible to download trace files on rooted devices using sky_tool stop_trace --- packages/flutter/lib/sky_tool | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/flutter/lib/sky_tool b/packages/flutter/lib/sky_tool index 301df38df6..e7c57a02dc 100755 --- a/packages/flutter/lib/sky_tool +++ b/packages/flutter/lib/sky_tool @@ -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)