Always invoke adb through function
Change-Id: I5956b3cf3ead3fdbf6399748359b324bc76001a0
diff --git a/deploy.py b/deploy.py
index 590e150..0db59e0 100755
--- a/deploy.py
+++ b/deploy.py
@@ -115,9 +115,7 @@
uninstall_apk(serial, app, prebuilts_dir)
# Copy the scenarios
- ret = subprocess.run(['adb', '-s', serial, 'push', scenarios_dir,
- '/sdcard/viser'], stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- universal_newlines=True)
+ ret = adb('push', scenarios_dir, '/sdcard/viser', serial=serial)
if 0 < ret.returncode:
print('Could not push the scenarios, error was: {}'.format(ret.stderr),
file=sys.stderr)
@@ -125,9 +123,7 @@
print('Scenarios pushed.')
# Copy the scenarios data
- ret = subprocess.run(['adb', '-s', serial, 'push', data_dir,
- '/sdcard/viser/data'], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE, universal_newlines=True)
+ ret = adb('push', data_dir, '/sdcard/viser/data', serial=serial)
if 0 < ret.returncode:
print('Could not push the scenarios data, error was: {}'.format(ret.stderr),
file=sys.stderr)
@@ -246,10 +242,9 @@
prepare_dut(serial, '../scenarios', '../scenarios-data', PREBUILTS_PATH)
# Start the viser app
- ret = subprocess.run(['adb', '-s', serial, 'shell', 'monkey', '-p',
- 'com.lunarlabs.panda', '-c', 'android.intent.category.LAUNCHER',
- '1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- universal_newlines=True)
+ ret = adb(
+ 'shell', 'monkey', '-p', 'com.lunarlabs.panda', '-c',
+ 'android.intent.category.LAUNCHER', '1', serial=serial)
if 0 < ret.returncode:
print('Could not start the viser app, error was: {}'.format(app,
ret.stderr), file=sys.stderr)