Adam Varhegyi
Adam Varhegyi

Reputation: 9924

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.

Upvotes: 3

Views: 423

Answers (2)

Artem Mostyaev
Artem Mostyaev

Reputation: 3908

You may find the option in the context menu of the LogCat. Just right click on it and select "Kill process":

popup menu

Upvotes: 0

Juanje
Juanje

Reputation: 1315

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.

Upvotes: 3

Related Questions