CCCPaste

Android force stop apps

#Android force stop processes/apps

#list running apps
adb shell dumpsys window windows
adb shell dumpsys window windows | grep 'mActivityRecord'
adb shell dumpsys window windows | grep 'mActivityRecord'|awk '{print $3}'|cut -d\/ -f1
adb shell dumpsys window windows | grep 'mActivityRecord'|awk '{print $3}'|cut -d\/ -f1|sort -u

#alias it
alias adbproc="adb shell dumpsys window windows | grep 'mActivityRecord'|awk '{print \$3}'|cut -d\/ -f1|sort -u"
adbproc

#force stop app
adb shell am force-stop com.android.messaging
adbproc|fzf

#put it all together
adb shell am force-stop "$(adbproc|fzf)"

#script:
https://gitlab.com/-/snippets/2561249