Created
December 15, 2015 09:07
-
-
Save xgouchet/36720fad6125127db052 to your computer and use it in GitHub Desktop.
Force kill a debuggable application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################### | |
# 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