Commit bcf164ca authored by John Budorick's avatar John Budorick Committed by Commit Bot

android: add `avd.py start` subcommand.

Bug: 922145
Change-Id: I4403bd2a500297bb1c1166dc87900e065f10a060
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913970
Auto-Submit: John Budorick <jbudorick@chromium.org>
Reviewed-by: default avatarYun Liu <yliuyliu@google.com>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715071}
parent 730de1cb
......@@ -78,7 +78,18 @@ def main(raw_args):
create_parser.set_defaults(func=create_cmd)
# TODO(jbudorick): Expose `start` as a subcommand.
start_parser = subparsers.add_parser(
'start',
help='Start an AVD instance with the given config.')
add_common_arguments(start_parser)
def start_cmd(args):
inst = avd.AvdConfig(args.avd_config).CreateInstance()
inst.Start(read_only=False, snapshot_save=True)
print('%s started (pid: %d)' % (str(inst), inst._emulator_proc.pid))
return 0
start_parser.set_defaults(func=start_cmd)
args = parser.parse_args(raw_args)
logging_common.InitializeLogging(args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment