| 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 import argparse | 6 import argparse |
| 7 import logging | 7 import logging |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 import devtools | 10 import devtools |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 debug_group.add_argument('--debug', help='Debug build (default)', | 42 debug_group.add_argument('--debug', help='Debug build (default)', |
| 43 default=True, action='store_true') | 43 default=True, action='store_true') |
| 44 debug_group.add_argument('--release', help='Release build', default=False, | 44 debug_group.add_argument('--release', help='Release build', default=False, |
| 45 dest='debug', action='store_false') | 45 dest='debug', action='store_false') |
| 46 parser.add_argument('--target-cpu', help='CPU architecture to run for.', | 46 parser.add_argument('--target-cpu', help='CPU architecture to run for.', |
| 47 choices=['x64', 'x86', 'arm']) | 47 choices=['x64', 'x86', 'arm']) |
| 48 parser.add_argument('--origin', help='Origin for mojo: URLs.') | 48 parser.add_argument('--origin', help='Origin for mojo: URLs.') |
| 49 parser.add_argument('--target-device', help='Device to run on.') | 49 parser.add_argument('--target-device', help='Device to run on.') |
| 50 parser.add_argument('--logcat-tags', help='Comma-separated list of ' | 50 parser.add_argument('--logcat-tags', help='Comma-separated list of ' |
| 51 'additional logcat tags to display on the console.') | 51 'additional logcat tags to display on the console.') |
| 52 parser.add_argument('--debugger', action="store_true", |
| 53 help='Run with mojo:debugger.') |
| 52 parser.add_argument('-v', '--verbose', action="store_true", | 54 parser.add_argument('-v', '--verbose', action="store_true", |
| 53 help="Increase output verbosity") | 55 help="Increase output verbosity") |
| 54 launcher_args, args = parser.parse_known_args() | 56 launcher_args, args = parser.parse_known_args() |
| 55 | 57 |
| 56 config = Config(target_os=Config.OS_ANDROID, | 58 config = Config(target_os=Config.OS_ANDROID, |
| 57 target_cpu=launcher_args.target_cpu, | 59 target_cpu=launcher_args.target_cpu, |
| 58 is_debug=launcher_args.debug) | 60 is_debug=launcher_args.debug) |
| 59 paths = Paths(config) | 61 paths = Paths(config) |
| 60 verbose_pipe = sys.stdout if launcher_args.verbose else None | 62 verbose_pipe = sys.stdout if launcher_args.verbose else None |
| 61 shell = AndroidShell(paths.adb_path, launcher_args.target_device, | 63 shell = AndroidShell(paths.adb_path, launcher_args.target_device, |
| 62 logcat_tags=launcher_args.logcat_tags, | 64 logcat_tags=launcher_args.logcat_tags, |
| 63 verbose_pipe=verbose_pipe) | 65 verbose_pipe=verbose_pipe) |
| 64 shell.InstallApk(paths.target_mojo_shell_path) | 66 shell.InstallApk(paths.target_mojo_shell_path) |
| 65 args.append("--origin=" + launcher_args.origin if launcher_args.origin else | 67 args.append("--origin=" + launcher_args.origin if launcher_args.origin else |
| 66 shell.SetUpLocalOrigin(paths.build_dir)) | 68 shell.SetUpLocalOrigin(paths.build_dir)) |
| 67 args = shell_arguments.RewriteMapOriginParameters(shell, args) | 69 args = shell_arguments.RewriteMapOriginParameters(shell, args) |
| 70 if launcher_args.debugger: |
| 71 args.extend(shell_arguments.ConfigureDebugger(shell)) |
| 68 shell.Run(args) | 72 shell.Run(args) |
| 69 return 0 | 73 return 0 |
| 70 | 74 |
| 71 | 75 |
| 72 if __name__ == "__main__": | 76 if __name__ == "__main__": |
| 73 sys.exit(main()) | 77 sys.exit(main()) |
| OLD | NEW |