OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_kill_skia: kills any skia processes on the device. | 3 # android_kill_skia: kills any skia processes on the device. |
4 | 4 |
5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
6 | 6 |
7 source $SCRIPT_DIR/utils/setup_adb.sh | 7 source $SCRIPT_DIR/utils/setup_adb.sh |
8 | 8 |
9 SERIAL="" | |
10 | |
11 while (( "$#" )); do | |
12 | |
13 if [[ "$1" == "-s" ]]; | |
14 then | |
15 if [[ $# -lt 2 ]]; | |
16 then | |
17 echo "ERROR: missing serial number" | |
18 exit 1; | |
19 fi | |
20 SERIAL="-s $2" | |
21 shift | |
22 fi | |
23 shift | |
24 done | |
25 | |
26 if [ $(uname) == "Linux" ]; then | 9 if [ $(uname) == "Linux" ]; then |
27 $ADB $SERIAL shell ps | grep skia | awk '{print $2}' | xargs -r $ADB $SERIAL
shell kill | 10 $ADB $DEVICE_SERIAL shell ps | grep skia | awk '{print $2}' | xargs -r $ADB
$DEVICE_SERIAL shell kill |
28 elif [ $(uname) == "Darwin" ]; then | 11 elif [ $(uname) == "Darwin" ]; then |
29 $ADB $SERIAL shell ps | grep skia | awk '{print $2}' | xargs $ADB $SERIAL sh
ell kill | 12 $ADB $DEVICE_SERIAL shell ps | grep skia | awk '{print $2}' | xargs $ADB $DE
VICE_SERIAL shell kill |
30 else | 13 else |
31 echo "Could not automatically determine OS!" | 14 echo "Could not automatically determine OS!" |
32 exit 1; | 15 exit 1; |
33 fi | 16 fi |
OLD | NEW |