Common user most of time doesn't care about RAM of his android device, about processes that running on background etc.
User who know what is RAM install apps to clear it. But we are not common users and wont install apps to kill. We gonna kill them ourselves.

You must be root, have busybox and terminal emu installed.

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

am kill only kills "processes that are safe to kill": i.e. a process with no running services or activities.

We can use adb shell kill to kill the process. but first you need to find the process id.

1)
adb shell kill $(adb shell ps | grep YOUR.PACKAGE.NAME | awk '{ print $2 }')

pc $ adb -d shell
android $ su
android # ps
android # kill <process id from ps output>

2)
adb shell am force-stop com.my.app.package

3)
adb stop com.my.app.package

4)
adb -d install -r MyApp.apk ; adb -d shell am start -a android.intent.action.MAIN -n com.MyCompany.MyApp/.MyActivity

5)
That way, you can issue this adb command to stop your activity:

adb shell am broadcast -a com.example.TestActivity.STOP

Add new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed.
CAPTCHA
 ooo        ooooo  ooooooooo.                                          .o8        oooo        
`88. .888' `888 `Y88. "888 `888
888b d'888 888 .d88' oooo oooo ooo ooo. .oo. .oo. 888oooo. 888 oooo
8 Y88. .P 888 888ooo88P' `88. `88. .8' `888P"Y88bP"Y88b d88' `88b 888 .8P'
8 `888' 888 888 `88..]88..8' 888 888 888 888 888 888888.
8 Y 888 888 `888'`888' 888 888 888 888 888 888 `88b.
o8o o888o o888o `8' `8' o888o o888o o888o `Y8bod8P' o888o o888o


Enter the code depicted in ASCII art style.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.