OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 from skypy.skyserver import SkyServer | 6 from skypy.skyserver import SkyServer |
7 import argparse | 7 import argparse |
8 import json | 8 import json |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 self.pids['build_dir'] = self.paths.build_dir | 220 self.pids['build_dir'] = self.paths.build_dir |
221 self.pids['sky_command_port'] = args.command_port | 221 self.pids['sky_command_port'] = args.command_port |
222 | 222 |
223 if is_android: | 223 if is_android: |
224 # TODO(eseidel): This should move into a helper method and handle | 224 # TODO(eseidel): This should move into a helper method and handle |
225 # failures with nice messages explaining how to get root. | 225 # failures with nice messages explaining how to get root. |
226 subprocess.check_call([ADB_PATH, 'root']) | 226 subprocess.check_call([ADB_PATH, 'root']) |
227 | 227 |
228 # We could make installing conditional on an argument. | 228 # We could make installing conditional on an argument. |
229 subprocess.check_call([ADB_PATH, 'install', '-r', apk_path]) | 229 # -r to replace an existing apk, -d to allow version downgrade. |
| 230 subprocess.check_call([ADB_PATH, 'install', '-r', '-d', apk_path]) |
230 | 231 |
231 port_string = 'tcp:%s' % sky_server.port | 232 port_string = 'tcp:%s' % sky_server.port |
232 subprocess.check_call([ | 233 subprocess.check_call([ |
233 ADB_PATH, 'reverse', port_string, port_string | 234 ADB_PATH, 'reverse', port_string, port_string |
234 ]) | 235 ]) |
235 self.pids['remote_sky_server_port'] = sky_server.port | 236 self.pids['remote_sky_server_port'] = sky_server.port |
236 | 237 |
237 port_string = 'tcp:%s' % args.command_port | 238 port_string = 'tcp:%s' % args.command_port |
238 subprocess.check_call([ | 239 subprocess.check_call([ |
239 ADB_PATH, 'forward', port_string, port_string | 240 ADB_PATH, 'forward', port_string, port_string |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 load_parser.set_defaults(func=self.load_command) | 625 load_parser.set_defaults(func=self.load_command) |
625 | 626 |
626 args = parser.parse_args() | 627 args = parser.parse_args() |
627 args.func(args) | 628 args.func(args) |
628 | 629 |
629 self._write_pid_file(PID_FILE_PATH, self.pids) | 630 self._write_pid_file(PID_FILE_PATH, self.pids) |
630 | 631 |
631 | 632 |
632 if __name__ == '__main__': | 633 if __name__ == '__main__': |
633 SkyDebugger().main() | 634 SkyDebugger().main() |
OLD | NEW |