######################################################################### # Kill a running android process function adb_kill { if [[ -z $1 ]]; then echo "Usage : adb_kill com.example.application" else process=`adb shell ps | grep $1` if [[ -n $process ]]; then pid=`echo $process | awk '{print $2}'` echo "Killing process $pid" adb shell "run-as $1 kill $pid" else echo "App $1 not launchd" fi fi }