Advertisement
metalx1000

Android force stop apps

Jun 22nd, 2023 (edited)
1,543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. #Android force stop processes/apps
  2.  
  3. #list running apps
  4. adb shell dumpsys window windows
  5. adb shell dumpsys window windows | grep 'mActivityRecord'
  6. adb shell dumpsys window windows | grep 'mActivityRecord'|awk '{print $3}'|cut -d\/ -f1
  7. adb shell dumpsys window windows | grep 'mActivityRecord'|awk '{print $3}'|cut -d\/ -f1|sort -u
  8.  
  9. #alias it
  10. alias adbproc="adb shell dumpsys window windows | grep 'mActivityRecord'|awk '{print \$3}'|cut -d\/ -f1|sort -u"
  11. adbproc
  12.  
  13. #force stop app
  14. adb shell am force-stop com.android.messaging
  15. adbproc|fzf
  16.  
  17. #put it all together
  18. adb shell am force-stop "$(adbproc|fzf)"
  19.  
  20. #script:
  21. https://gitlab.com/-/snippets/2561249
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement