6

I want to kill app process of my app for testing purpose. I want to test activity restoration. I send my app to background by pressing home button. Then I run this command adb shell am kill <PACKAGE_NAME> in Android Studio terminal, but it doesn't kill app process.

TikTak
  • 713
  • 1
  • 11
  • 23
  • 1
    Try with adb shell pm clear – saurabh1489 Apr 26 '20 at 16:41
  • Or check this answer https://stackoverflow.com/a/17829677/2110064 – saurabh1489 Apr 26 '20 at 16:43
  • Does your app has persistent=true in the manifest? If it doesn't, maybe your app is restarting. If you have root on your device/emulator, try killing it using kill -9 (inside your device shell) – user3467955 Apr 26 '20 at 16:54
  • I use adb shell ps to show proccess in my OS. After adb shell am kill , I check with adb shell ps, but my app exist in proccess list – TikTak Apr 26 '20 at 19:02
  • In manifest persistent=true doesn't exist – TikTak Apr 26 '20 at 19:03
  • I can't use adb shell am kill , but I can use adb shell kill . But there is different both of them. I want to use adb shell am kill . I will try find out what the problem. – TikTak Apr 26 '20 at 19:20

1 Answers1

1

Use force-stop instead

adb shell am force-stop package-name
Elye
  • 53,639
  • 54
  • 212
  • 474