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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 sky_server = self.sky_server_for_args(args) | 188 sky_server = self.sky_server_for_args(args) |
189 self.pids['sky_server_pid'] = sky_server.start() | 189 self.pids['sky_server_pid'] = sky_server.start() |
190 self.pids['sky_server_port'] = sky_server.port | 190 self.pids['sky_server_port'] = sky_server.port |
191 self.pids['sky_server_root'] = sky_server.root | 191 self.pids['sky_server_root'] = sky_server.root |
192 | 192 |
193 self.pids['build_dir'] = self.paths.build_dir | 193 self.pids['build_dir'] = self.paths.build_dir |
194 self.pids['sky_command_port'] = args.command_port | 194 self.pids['sky_command_port'] = args.command_port |
195 | 195 |
196 if is_android: | 196 if is_android: |
| 197 subprocess.check_call([ADB_PATH, 'root']) |
| 198 |
197 # We could make installing conditional on an argument. | 199 # We could make installing conditional on an argument. |
198 apk_path = os.path.join(self.paths.build_dir, 'apks', | 200 apk_path = os.path.join(self.paths.build_dir, 'apks', |
199 ANDROID_APK_NAME) | 201 ANDROID_APK_NAME) |
200 subprocess.check_call([ADB_PATH, 'install', '-r', apk_path]) | 202 subprocess.check_call([ADB_PATH, 'install', '-r', apk_path]) |
201 | 203 |
202 port_string = 'tcp:%s' % sky_server.port | 204 port_string = 'tcp:%s' % sky_server.port |
203 subprocess.check_call([ | 205 subprocess.check_call([ |
204 ADB_PATH, 'reverse', port_string, port_string | 206 ADB_PATH, 'reverse', port_string, port_string |
205 ]) | 207 ]) |
206 self.pids['remote_sky_server_port'] = sky_server.port | 208 self.pids['remote_sky_server_port'] = sky_server.port |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 load_parser.set_defaults(func=self.load_command) | 594 load_parser.set_defaults(func=self.load_command) |
593 | 595 |
594 args = parser.parse_args() | 596 args = parser.parse_args() |
595 args.func(args) | 597 args.func(args) |
596 | 598 |
597 self._write_pid_file(PID_FILE_PATH, self.pids) | 599 self._write_pid_file(PID_FILE_PATH, self.pids) |
598 | 600 |
599 | 601 |
600 if __name__ == '__main__': | 602 if __name__ == '__main__': |
601 SkyDebugger().main() | 603 SkyDebugger().main() |
OLD | NEW |