1

I have this new app that I got from the Play store which allows me to make shortcuts for certain actions. For my likings, I want to make it so that if I hold the volume up button, it would kill the app. (Not minimize, but kill). It doesn't have that option but it does have an option to have a terminal emulation shortcut.

Please help. Thanks

Taylor
  • 2,981
  • 2
  • 29
  • 70
  • This looks like it may help.. http://android.stackexchange.com/questions/45202/terminal-or-adb-command-to-force-stop-application – JDM Oct 03 '14 at 23:04
  • @jmejiaa but you would need a package name for that. I just want it so that when I press the button, the app that is currently open will be killed. – Taylor Oct 03 '14 at 23:08
  • Get the current package name like so.. http://stackoverflow.com/questions/13193592/adb-android-getting-the-name-of-the-current-activity – JDM Oct 03 '14 at 23:55

2 Answers2

3

killing the app:

  adb shell am kill com.myapp.package

stopping the app using adb:

  adb shell am force-stop com.myapp.package

more info:

https://developer.android.com/tools/help/adb.html#am

Community
  • 1
  • 1
Jorgesys
  • 124,308
  • 23
  • 334
  • 268
0

You can use am force-stop <package name> and am kill <package name>