summaryrefslogtreecommitdiffstats
path: root/build/android/adb_kill_blimp_client
blob: 6221e45234aa01d846254d46b45a43332d2c79ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#
# Copyright 2015 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 instance of Blimp.
#
# Assumes you have sourced the build/android/envsetup.sh script.

SHELL_PID_LINES=$(adb shell ps | grep -w 'org.chromium.blimp')
VAL=$(echo "$SHELL_PID_LINES" | wc -l)
if [ $VAL -lt 1 ] ; then
   echo "Not running Blimp."
else
   SHELL_PID=$(echo $SHELL_PID_LINES | awk '{print $2}')
   if [ "$SHELL_PID" != "" ] ; then
      set -x
      adb shell kill $SHELL_PID
      set -
   else
     echo "Blimp does not appear to be running."
   fi
fi