Why does spoofing turn off by itself in the background on Xiaomi?

MIUI and HyperOS (Xiaomi, Redmi, POCO) kill background apps more aggressively than others. Turn on autostart for Mock Location and remove battery restrictions — the app suggests this on first launch.

Spoofing is held by a background service, and “turned off by itself” almost always means the firmware closed it. In system logs this shows as the process being force-stopped by the system, not as an app error.

Then something non-obvious happens: the test providers stay registered in Android with the last written value, but nobody writes new coordinates into them — the process that created them no longer exists. From the outside this looks like “spoofing froze”: the point stays the same but stops updating, and after a while the system returns the real location. That is why the problem is often not noticed right away.

Xiaomi, Redmi and POCO owners run into this most often: MIUI and HyperOS manage background processes more strictly than others. It is fixed with three settings — autostart, removing battery restrictions and locking the app in recents; a walkthrough with exact paths is in the separate Xiaomi guide. If you only do one of the three, do autostart: without it, after the process is closed the system will not bring the service back at all, and spoofing will not return until you open the app yourself. With autostart on, the system brings the service back within seconds, the app picks up the saved state and continues without your involvement.

On Samsung the cause is the same, but the mechanism is called “Sleeping apps”: One UI automatically puts to sleep what you have not used for a while, and a spoofing app looks idle exactly while the phone is in your pocket. Paths for One UI are in the Samsung guide. On Huawei and Honor, turn off automatic launch management and turn on all three switches — auto-launch, secondary launch and run in background; details are in the Huawei guide.

On its side, the app does two independent things. When opened, it compares the saved state with the actual one and, if the process died, brings spoofing back — this path always works. In addition, a watchdog timer periodically checks the state in the background and tries to restore the service itself. But both have a limit: if the firmware forbids the app to start in the background, the service cannot be brought back without you — the code simply does not run at that moment. So the firmware settings cannot be replaced programmatically.

The easiest way to check the result is the persistent notification in the shade: while it is there, the service is alive. If it is gone, the system got to it after all, and you should go back to the settings above.

Still have questions? Write to support.