I usually have to test certain crashes with the terminate app button in Android studio. But now I need other testers to do the same without IDE, is there a way to terminate an app from terminal? Some ADB command?
Asked
Active
Viewed 2,478 times
0
-
What do you mean by terminate? Do you mean 'Force Stop' ? You can do this in the Device itself. – Henry Oct 26 '15 at 13:22
-
1This is a duplicate question, check this: [Android ADB stop application command like “force-stop” for non rooted device](http://stackoverflow.com/q/17829606/3099776) – Lucas L. Oct 26 '15 at 13:34
3 Answers
2
You can use
adb shell pm clear com.my.app.package
which will stop the app process and clear out all the stored data for that app.
Also, you can close forcefully by using pid
,
adb shell kill <PID>

VVB
- 7,363
- 7
- 49
- 83
1
Kill is probably your friend here
You can list all running processes on the device and their process ids
adb shell ps
Instead of use process id of your application
adb shell kill <PID>

Eugene
- 1,865
- 3
- 21
- 24
1
adb killall
and adb shell kill PID
will work if you have privilege But
is an awesome command to play with adb. Have you tried?
am force-stop "your.package.name"

Madhukar Hebbar
- 3,113
- 5
- 41
- 69