Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1066)

Unified Diff: mojo/devtools/common/devtoolslib/android_shell.py

Issue 1376603007: Teach mojo_benchmark --save-traces to pull results from Android devices. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address Etienne's comments. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/devtools/common/mojo_benchmark » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/devtoolslib/android_shell.py
diff --git a/mojo/devtools/common/devtoolslib/android_shell.py b/mojo/devtools/common/devtoolslib/android_shell.py
index a4a7d16db7261e650c0c776564dc35a6655e537b..abda378e68225c2a29d8da0efe049d013cc3b84c 100644
--- a/mojo/devtools/common/devtoolslib/android_shell.py
+++ b/mojo/devtools/common/devtoolslib/android_shell.py
@@ -199,6 +199,21 @@ class AndroidShell(Shell):
return len(subprocess.check_output(self._adb_command([
'shell', 'pm', 'list', 'packages', _MOJO_SHELL_PACKAGE_NAME]))) > 0
+ @staticmethod
+ def get_tmp_dir_path():
+ """Returns a path to a cache directory owned by the shell where temporary
+ files can be stored.
+ """
+ return '/data/data/%s/cache/tmp/' % _MOJO_SHELL_PACKAGE_NAME
+
+ def pull_file(self, device_path, destination_path, remove_original=False):
+ """Copies or moves the specified file on the device to the host."""
+ subprocess.check_call(self._adb_command([
+ 'pull', device_path, destination_path]))
+ if remove_original:
+ subprocess.check_call(self._adb_command([
+ 'shell', 'rm', device_path]))
+
def check_device(self, require_root=False):
"""Verifies if the device configuration allows adb to run.
« no previous file with comments | « no previous file | mojo/devtools/common/mojo_benchmark » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698