OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 Google Inc. |
| 2 # |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import subprocess |
| 7 |
| 8 def shell(cmd, device_serial=None): |
| 9 if device_serial is None: |
| 10 subprocess.call(['adb', 'shell', cmd]) |
| 11 else: |
| 12 subprocess.call(['adb', '-s', device_serial, 'shell', cmd]) |
| 13 |
| 14 def check(cmd, device_serial=None): |
| 15 if device_serial is None: |
| 16 out = subprocess.check_output(['adb', 'shell', cmd]) |
| 17 else: |
| 18 out = subprocess.check_output(['adb', '-s', device_serial, 'shell', cmd]) |
| 19 return out.rstrip() |
OLD | NEW |