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

Side by Side Diff: mojo/tools/android_mojo_shell.py

Issue 1159063004: Support running with mojo:debugger in devtools. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address Ben's comments. 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 unified diff | Download patch
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_arguments.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
OLDNEW
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_arguments.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698