Chromium Code Reviews| Index: mojo/devtools/common/android_gdb/install_remote_file_reader.py |
| diff --git a/mojo/devtools/common/android_gdb/install_remote_file_reader.py b/mojo/devtools/common/android_gdb/install_remote_file_reader.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..74878784a966ae937b7edf8ede1be4ef23136e4e |
| --- /dev/null |
| +++ b/mojo/devtools/common/android_gdb/install_remote_file_reader.py |
| @@ -0,0 +1,20 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import android_gdb.config as config |
| +import subprocess |
| +import tempfile |
| + |
| + |
| +def install_binary(gsutil, adb='adb'): |
|
ppi
2015/07/09 13:12:38
install_binary -> install_remote_file_reader
qsr
2015/07/09 13:54:18
Given the name of the python package, what about j
etiennej
2015/07/15 07:13:20
Done.
|
| + verification_call_output = subprocess.check_output( |
| + [adb, 'shell', 'ls', config.REMOTE_FILE_READER_DEVICE_PATH]) |
| + if config.REMOTE_FILE_READER_DEVICE_PATH != verification_call_output.strip(): |
| + with tempfile.NamedTemporaryFile() as temp_file: |
| + subprocess.check_call([gsutil, 'cp', config.REMOTE_FILE_READER_CLOUD_PATH, |
| + temp_file.name]) |
| + subprocess.check_call([adb, 'push', temp_file.name, |
| + config.REMOTE_FILE_READER_DEVICE_PATH]) |
| + subprocess.check_call([adb, 'shell', 'chmod', '777', |
| + config.REMOTE_FILE_READER_DEVICE_PATH]) |