Why Android keeps killing the app while you are still using it
A session that works for two minutes and then dies with no error is almost never a bug in the app. It is Android deciding the app should stop, and on some manufacturers that decision is far more aggressive than anything Google ships.
Three separate systems, often blamed as one
Doze. When the phone has been stationary, unplugged and screen-off for a while, Android batches network access and defers background work. It is the mildest of the three and it mostly affects a phone nobody is holding.
App Standby buckets. Android sorts apps by how often you actually use them — active, working set, frequent, rare, restricted — and restricts background work accordingly. An app you installed for one support call sits in a low bucket and gets treated harshly.
Manufacturer battery managers. This is the one that actually causes the problem. Xiaomi, Huawei, Oppo, Vivo, Samsung and others layer their own killers on top of Android, and they are considerably more aggressive than stock. On some devices an app is stopped within minutes of leaving the foreground regardless of what Android itself would allow.
The one exemption that matters
An app doing continuous work you can see — capturing a screen, playing music, navigating — is supposed to run a foreground service, which is why you see a persistent notification while sharing. A foreground service is largely protected from Doze and standby.
It is not protected from the manufacturer layer. That layer will stop a foreground service too, and it will do it without telling you or the app. The persistent notification simply disappears.
What to change, in order of effect
- Turn off battery optimisation for the app. Settings → Apps → the app → Battery → Unrestricted. On many devices this alone fixes it.
- Lock the app in recents. On Xiaomi, Oppo and several others, open the app switcher and use the padlock on the app card. This is a manufacturer feature with no equivalent in stock Android, and on those devices it matters more than any Android setting.
- Turn off "adaptive battery" for it if the manufacturer exposes a per-app switch.
- Allow autostart. Xiaomi, Huawei, Oppo and Vivo have an autostart list that is off by default for everything. An app that is not on it cannot restart itself after being killed.
- Keep the screen on while sharing, or use the app's own keep-awake option if it has one. A screen that stays on is the strongest signal to the system that something is in use.
- Do not "clean" or swipe the app away. Swiping it out of recents is an explicit instruction to stop it, and cleaner apps do that on a schedule.
Telling this apart from a network problem
| Symptom | Which layer |
|---|---|
| Dies about a minute after the screen goes off | Battery manager or Doze |
| Dies right after switching to another app | Manufacturer killer — lock it in recents |
| Dies at random while actively in use | Memory pressure — close other apps |
| Never connects at all | Not this — see the pairing guide |
| Connects, then quality degrades but survives | Network, not background limits |
| Stops after a restart and does not come back | Autostart not permitted |
The trade-off, stated honestly
Everything above disables a battery-saving measure. On a phone doing screen capture that is the correct choice for the duration of a session, and the wrong choice as a permanent setting for an app you use once a month. The reasonable pattern is to exempt the app, use it, and not worry about it — the drain from an idle exempted app is small, while the drain from an active screen-sharing session is real and unavoidable. See what a session actually costs in battery and data.
More guides
What a screen sharing session actually costs in battery and data
Encoding, radio and a screen that has to stay on all draw power at once. Realistic figures per hour, what drives them, and the settings that cut both roughly in half.
Why the remote tap lands late, and which of the five causes is yours
Capture, encode, network, decode and the input path back each add delay. How to tell them apart from the symptom, and the fixes that actually change the number.
What happens when the shared phone locks or its screen goes off
Locking, the screen timing out and the phone being pocketed are three different events with three different outcomes. Why sessions die there, and what to change.
Try Remote Phone
Share an Android screen, or control one from another phone or your computer's browser. No account needed.
Try Remote Phone