androidandroid-studioandroid-background

How to force stop an app with Android Studio to test background lifecycle mechanism?


So I would like to test what happens with my application when the user puts it to the background and after a while the OS would free up memory thus kill the app, and I would like to re-open it again to see whether my states are restored etc.

I remember (maybe badly) there was a red stop button on the left side of logcat which would kill the app in if you put it to the background. Right? I think it was removed in the recent update of Android Studio maybe?


I'm talking about this area (place of the stop button (was))

enter image description here

Any help is greatly appreciated, thank you.


Solution

  • Play/Stop buttons are now placed in Run tab. Since there is the possibility to have multiple logcats, you need to manage the app status in the Run tab.

    Regards.