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

Unified Diff: mojo/devtools/common/android_gdb/install_remote_file_reader.py

Issue 1209593002: GDB support for Android in devtools' debugger. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
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..089e0d023133686b580c5b5779f5b813910dcaa4
--- /dev/null
+++ b/mojo/devtools/common/android_gdb/install_remote_file_reader.py
@@ -0,0 +1,19 @@
+# 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 config
+import subprocess
+import tempfile
+
ppi 2015/06/24 15:14:07 The style guide wants two blank lines here I think
etiennej 2015/06/29 15:41:42 Done.
+def install_binary(gsutil, adb='adb'):
+ 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])

Powered by Google App Engine
This is Rietveld 408576698