Skip to content

Instantly share code, notes, and snippets.

@xgouchet
Created December 15, 2015 09:07
Show Gist options
  • Save xgouchet/36720fad6125127db052 to your computer and use it in GitHub Desktop.
Save xgouchet/36720fad6125127db052 to your computer and use it in GitHub Desktop.
Force kill a debuggable application
#########################################################################
# 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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment