0

I want simulate the situation when my app killed by OS.

Example: I've hidden my app (by pressing middle circle nav button) and opened any other app, now I need to kill process and observe what would be if I open app from recent opened app list(by pressing right rect nav button).

How I can simulate killing app by OS?

enter image description here

2 Answers2

1

You can simply kill your app by using adb.

adb shell am force-stop <YOUR_PACKAGE>
ocos
  • 1,901
  • 1
  • 10
  • 12
0

I also find another way in android studio, when I run my app, there is a button "Terminate Application" in the Logcat window

enter image description here

  • 3
    Please note that the "Terminate Application" button will move from logcat to the new device monitor soon, see https://issuetracker.google.com/issues/246928842 – m.reiter Sep 20 '22 at 09:54