diff options
author | msw <msw@chromium.org> | 2015-04-23 13:31:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-23 20:31:35 +0000 |
commit | 209e4b1664b39f3f3d0749e9a6c881176f03ca7f (patch) | |
tree | 8da3d0f94a77f91d52d4db06e647b4719ba2b0d0 /mojo | |
parent | 86578ecb7b5ac34212f2a69527809d949a1d6d19 (diff) | |
download | chromium_src-209e4b1664b39f3f3d0749e9a6c881176f03ca7f.zip chromium_src-209e4b1664b39f3f3d0749e9a6c881176f03ca7f.tar.gz chromium_src-209e4b1664b39f3f3d0749e9a6c881176f03ca7f.tar.bz2 |
Update android_mojo_shell.py from the Mojo repository.
This mirrors the update of mojo/tools/mopy/android.py from:
https://codereview.chromium.org/996523003/
Patch Set 1 is a straight copy of the Mojo repo file.
Patch Set 2+ diverges as needed for the Chromium repo.
BUG=479230
TEST=Script runs mojo apps on Android correctly.
R=sky@chromium.org
Review URL: https://codereview.chromium.org/1106463004
Cr-Commit-Position: refs/heads/master@{#326631}
Diffstat (limited to 'mojo')
-rwxr-xr-x | mojo/tools/android_mojo_shell.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/mojo/tools/android_mojo_shell.py b/mojo/tools/android_mojo_shell.py index e269228..ca86672 100755 --- a/mojo/tools/android_mojo_shell.py +++ b/mojo/tools/android_mojo_shell.py @@ -7,13 +7,16 @@ import argparse import logging import sys +from mopy.android import AndroidShell from mopy.config import Config -from mopy import android +from mopy.paths import Paths + +USAGE = ("android_mojo_shell.py [<shell-and-app-args>] [<mojo-app>]") def main(): logging.basicConfig() - parser = argparse.ArgumentParser("Helper for running mojo_shell") + parser = argparse.ArgumentParser(usage=USAGE) debug_group = parser.add_mutually_exclusive_group() debug_group.add_argument('--debug', help='Debug build (default)', @@ -23,18 +26,22 @@ def main(): parser.add_argument('--target-cpu', help='CPU architecture to run for.', choices=['x64', 'x86', 'arm']) parser.add_argument('--origin', help='Origin for mojo: URLs.') + parser.add_argument('--target-device', help='Device to run on.') launcher_args, args = parser.parse_known_args() config = Config(target_os=Config.OS_ANDROID, target_cpu=launcher_args.target_cpu, is_debug=launcher_args.debug) + paths = Paths(config) + shell = AndroidShell(paths.target_mojo_shell_path, paths.build_dir, + paths.adb_path, launcher_args.target_device) - extra_shell_args = android.PrepareShellRun(config, launcher_args.origin) + extra_shell_args = shell.PrepareShellRun(launcher_args.origin) args.extend(extra_shell_args) - android.CleanLogs() - p = android.ShowLogs() - android.StartShell(args, sys.stdout, p.terminate) + shell.CleanLogs() + p = shell.ShowLogs() + shell.StartShell(args, sys.stdout, p.terminate) return 0 |