From 0a70b9f2f5fad8b3176eeb10663d96e8f57f6b89 Mon Sep 17 00:00:00 2001 From: "william.xie" Date: Thu, 8 Jan 2015 17:27:27 -0800 Subject: [PATCH] Add util scripts for killing chrome shell. BUG=None TEST= Review URL: https://codereview.chromium.org/841013003 Cr-Commit-Position: refs/heads/master@{#310652} --- build/android/adb_kill_chrome_shell | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 build/android/adb_kill_chrome_shell diff --git a/build/android/adb_kill_chrome_shell b/build/android/adb_kill_chrome_shell new file mode 100755 index 000000000000..2b63c9af3d24 --- /dev/null +++ b/build/android/adb_kill_chrome_shell @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Copyright (c) 2012 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. +# +# Kill a running chrome shell. +# +# Assumes you have sourced the build/android/envsetup.sh script. + +SHELL_PID_LINES=$(adb shell ps | grep ' org.chromium.chrome.shell') +VAL=$(echo "$SHELL_PID_LINES" | wc -l) +if [ $VAL -lt 1 ] ; then + echo "Not running Chrome shell." +else + SHELL_PID=$(echo $SHELL_PID_LINES | awk '{print $2}') + if [ "$SHELL_PID" != "" ] ; then + set -x + adb shell kill $SHELL_PID + set - + else + echo "Chrome shell does not appear to be running." + fi +fi -- 2.11.4.GIT