From 39b34473104320dcf5c9c229bbb6b26309e63fa6 Mon Sep 17 00:00:00 2001 From: sanfin Date: Wed, 2 Mar 2016 10:32:10 -0800 Subject: [PATCH] Replaced apk_command_line with adb_cast_shell_command_line. The new script uses the adb_command_line.py script in build/android and is therefore compatible with the --device argument. BUG= internal b/26406816 Review URL: https://codereview.chromium.org/1750393003 Cr-Original-Commit-Position: refs/heads/master@{#378780} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 24d7960decb02198c73a9fcd3e847de8e97702fe --- android/adb_cast_shell_command_line | 22 ++++++++++++++++++++++ android/adb_command_line.py | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 android/adb_cast_shell_command_line diff --git a/android/adb_cast_shell_command_line b/android/adb_cast_shell_command_line new file mode 100755 index 000000000..bcbcbeb2f --- /dev/null +++ b/android/adb_cast_shell_command_line @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# If no flags are given, prints the current cast shell flags. +# +# Otherwise, the given flags are used to REPLACE (not modify) the cast shell +# flags. For example: +# apk_command_line --enable-media-thread-for-media-playback +# +# If multiple devices are connected, use the --device argument to specify the +# device ID. You can use +# adb devices +# ... to find the device's ID. +# +# To remove all content shell flags, pass an empty string for the flags: +# apk_command_line "" + +exec $(dirname $0)/../../build/android/adb_command_line.py -e cast_shell \ + --device-path /data/local/tmp/castshell-command-line "$@" diff --git a/android/adb_command_line.py b/android/adb_command_line.py index a74094d6f..c242aa1c0 100755 --- a/android/adb_command_line.py +++ b/android/adb_command_line.py @@ -28,6 +28,8 @@ Otherwise: Writes command-line file. help='Target device for apk to install on.') parser.add_argument('--device-path', required=True, help='Remote path to flags file.') + parser.add_argument('-e', '--executable', dest='executable', default='chrome', + help='Name of the executable.') args, remote_args = parser.parse_known_args() devil_chromium.Initialize() @@ -71,7 +73,7 @@ Otherwise: Writes command-line file. # Set flags. quoted_args = ' '.join(cmd_helper.SingleQuote(x) for x in remote_args) - flags_str = 'chrome %s' % quoted_args + flags_str = ' '.join([args.executable, quoted_args]) def write_flags(device): device.WriteFile(args.device_path, flags_str, as_root=as_root)