Update check in KillingRendererClearsDescendantProxies test.
[chromium-blink-merge.git] / mojo / tools / android_mojo_shell.py
blobb3106494ce4d05c1c91e5b8f1ba2c9a62fb02191
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
6 import argparse
7 import logging
8 import sys
10 from mopy.android import AndroidShell
11 from mopy.config import Config
12 from mopy.paths import Paths
14 USAGE = ("android_mojo_shell.py [<shell-and-app-args>] [<mojo-app>]")
16 def main():
17 logging.basicConfig()
19 parser = argparse.ArgumentParser(usage=USAGE)
21 debug_group = parser.add_mutually_exclusive_group()
22 debug_group.add_argument('--debug', help='Debug build (default)',
23 default=True, action='store_true')
24 debug_group.add_argument('--release', help='Release build', default=False,
25 dest='debug', action='store_false')
26 parser.add_argument('--target-cpu', help='CPU architecture to run for.',
27 choices=['x64', 'x86', 'arm'], default='arm')
28 parser.add_argument('--origin', help='Origin for mojo: URLs.',
29 default='localhost')
30 parser.add_argument('--target-device', help='Device to run on.')
31 launcher_args, args = parser.parse_known_args()
33 config = Config(target_os=Config.OS_ANDROID,
34 target_cpu=launcher_args.target_cpu,
35 is_debug=launcher_args.debug,
36 apk_name="MojoRunner.apk")
37 paths = Paths(config)
38 shell = AndroidShell(paths.apk_path, paths.build_dir, paths.adb_path,
39 launcher_args.target_device)
41 extra_shell_args = shell.PrepareShellRun(launcher_args.origin)
42 args.extend(extra_shell_args)
44 shell.CleanLogs()
45 p = shell.ShowLogs()
46 shell.StartShell(args, sys.stdout, p.terminate)
47 return 0
50 if __name__ == "__main__":
51 sys.exit(main())