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

Unified Diff: tools/skpbench/_adb.py

Issue 2350003002: Add adb support to skpbench (Closed)
Patch Set: Created 4 years, 3 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 | tools/skpbench/_adb_path.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/_adb.py
diff --git a/tools/skpbench/_adb.py b/tools/skpbench/_adb.py
new file mode 100644
index 0000000000000000000000000000000000000000..6125c8d538fa8cc46ad338abd6d4ef1d1315080a
--- /dev/null
+++ b/tools/skpbench/_adb.py
@@ -0,0 +1,19 @@
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import subprocess
+
+def shell(cmd, device_serial=None):
+ if device_serial is None:
+ subprocess.call(['adb', 'shell', cmd])
+ else:
+ subprocess.call(['adb', '-s', device_serial, 'shell', cmd])
+
+def check(cmd, device_serial=None):
+ if device_serial is None:
+ out = subprocess.check_output(['adb', 'shell', cmd])
+ else:
+ out = subprocess.check_output(['adb', '-s', device_serial, 'shell', cmd])
+ return out.rstrip()
« no previous file with comments | « no previous file | tools/skpbench/_adb_path.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698