Xiaomiβs MIUI-based smartphones are known for aggressive battery optimization, which often leads to forced closure of applications in the background, including instant messengers, activity trackers, music players, and even system utilities. If your app constantly crashes or stops sending notifications, the problem lies in the power saving settings and MIUI permissions.
In this article, weβll look at all the official and hidden ways to get an app to work in the background on Xiaomi, from basic autostart settings to editing system files for power users. The instructions are relevant for MIUI 12/13/14 and models from Redmi Note 10 to Xiaomi 14 Pro, but most methods work on older versions as well.
Importantly, some of the limitations of MIUI are related to Googleβs energy efficiency policy (the Android Doze project), but Xiaomi is adding its own layers of optimization. So standard tips for pure Android wonβt work here β you need MIUI-specific solutions.
Why Xiaomi is closing apps in the background?
MIUI firmware uses three levels of background control:
- π Battery optimization β the system automatically suspends apps if they are not actively used (even if they need to run in the background, like Telegram or Spotify).
- π« Autorun Limitation β By default, most applications are not allowed to run on their own after restarting or closing.
- β‘ Doze Aggressive Mode β if the device is not used for a long time, MIUI Blocks network activity and background tasks to save charge.
In addition, newer models (Xiaomi 13/14, Redmi Note 12) have added MIUI Optimization, which analyzes user behavior and further restricts background processes, for example, if you rarely open Viber, the system will consider it βunnecessaryβ and will close 5-10 minutes after curtailing.
Another reason is the division into βimportantβ and βnon-importantβ applications: MIUI by default allows background work only for system services (for example, Mi Cloud or Security), and third-party programs are blacklisted, this applies even to popular messengers, if they are installed not from Google Play, but through APK.
Method 1: Setup auto-start application
The first thing you need to do is allow the application to automatically start after restarting or closing, without which even the permitted background processes will be blocked.
- Open Settings β Applications β Application Management.
- Select the desired application (for example, WhatsApp or Yandex.Navigator).
- Slip on Autostart and switch on the switch.
- Go back and click Permissions β Additional β Show float windows (for some applications).
If AutoRun is not in the app menu, try an alternative path:
- Go to Settings β Battery and Performance β Battery Management.
- Choose App Choices (or Battery Optimization in Newer Versions).
- Find your app and set up the No Limits mode.
On some models (POCO F4, Xiaomi 12T) the AutoRun item is hidden to find it:
Settings β Applications β (three dots at the top) β Special access β AutoRunAuto-start enabled in the application settings
Allowed to be displayed over other windows (if necessary)
The application is excluded from battery optimization
Notification permissions checked-->
Method 2: Disabling Battery Optimization
Even if auto-start is enabled, MIUI can pause the application through power saving mode to fix this:
- Open Settings β Battery and Performance β Battery Management
- Select Application Choice (or Battery Optimization in MIUI 14).
- Find your app in the list and set the No Limits mode.
- If the app is not listed, tap on All Apps and find it manually.
For MIUI 13/14, the path may be different:
Settings β Battery β Battery Mode β Select Apps β (select App) β Without LimitsSome devices (Redmi 10, POCO X3) have an additional item called Deep Optimization, which should also be disabled for critical applications (for example, health trackers or banking programs).
β οΈ Warning: Disabling battery optimization for a large number of applications will reduce battery life.We recommend leaving no more than 5-7 programs without restrictions.
What if there is no βNo Limitationsβ clause?
Method 3: Allow blocking and notifications
Often, apps are closed in the background due to blocked notifications or a lack of permits to work in the background.
- π± Notifications Allowance: Settings β Annexes β Application management β (select the application) β Notifications β Turn on all the switches.
- π Permission to work in the background: in the same settings of the application, find the Background Activity or Background Work item and turn it on.
- π‘οΈ Exclusion from memory cleaning: Settings β Annexes β Cleaning up memory β (three-point) β Ignored applications β add your own.
For instant messengers (Telegram, Viber, WhatsApp) additionally check:
- Permission to Autoload Media (in the settings of the messenger).
- No restrictions in Settings β Communication and Sharing β Data Use (if the application works via mobile Internet).
MIUI 14 has a new item Intelligent control in the battery settings, it must be turned off for applications that must work constantly (for example, Yandex.Maps or Waze):
Settings β Battery β Intelligent Control β (disable for the desired application)Method 4: Using Hidden MIUI Settings (for experienced)
If standard methods don't work, you can use hidden MIUI settings that don't show up in the default interface.
- Turn on Developer Mode: Settings β About Phone β MIUI Version (shap 7 times)
- Activate debugging over USB: Settings β Additional β For developers β Debugging over USB
- Connect your phone to the PC and use it ADB-team.
Mainstream ADB-teaming:
| Team team. | Description | Example |
|---|---|---|
| adb shell cmd appops set <packet> RUN_ANY_IN_BACKGROUND allow | Allows work in the background for any process | adb shell cmd appops set com.whatsapp RUN_ANY_IN_BACKGROUND allow |
| adb shell dumpsys deviceidle whitelist +<pack> | Excluding Doze from the regime | adb shell dumpsys deviceidle whitelist +org.telegram.messenger |
| adb shell settings put global hidden_api_policy 1 | Unlocks hidden APIs (reboot required) | β |
| adb shell am force-stop <package> | Forced stop of the application (if it is suspended) | adb shell am force-stop com.facebook.katana |
In the models with MIUI 13+ Appops commands may not work because of the additional protection, in which case only manual file editing will help. /data/system/package_restrictions.xml (root).
β οΈ Attention: Misuse of the right ADB-commands can cause system failures. Before experimenting, back up your data through Settings β Additionally. β Backup and reset.
π‘
If you donβt want to use ADB, try the MIUI Hidden Settings app from Google Play, which provides access to hidden settings without a command line, but doesnβt work on all models.
Method 5: Alternative solutions (if nothing helps)
If the app still closes in the background, try the following methods:
- π Reinstall the app β sometimes a clean installation helps (remove cache and data in Settings) β Pre-deletion annexes).
- π¦ Use the version from Google Play β applications installed through APK, more frequently blocked MIUI.
- π Turn off the power saving mode completely: Settings β Battery β Battery mode β Productivity (this will reduce work time but solve the background work problem).
- π οΈ Use third-party utilities: - Greenify (for manual control of background processes); - AutoStart (aut-run control); - Shizuku + AppOps (for deep permission settings).
For some applications (such as PokΓ©mon GO or Strava), it helps to simulate user activity.
- Enable Developer Mode (see above).
- Activate the option Do not turn off the screen while charging:
- Connect your phone to charge and start the app β MIUI wonβt pause it while the screen is on.
On models with MIUI 14, we have an application freeze feature that completely blocks background activity, to turn it off:
Settings β Applications β (three points) β Special access β Application Freeze β (remove the tick from the desired application)Compatibility table with MIUI versions
Not all methods work on all firmware versions. Below is a compatibility summary table:
| Method | MIUI 12 | MIUI 13 | MIUI 14 | Notes |
|---|---|---|---|---|
| Auto-Start through Application Settings | β | β | β | On some models, the item is hidden in Special Access |
| Disabling battery optimization | β | β οΈ | β οΈ | MIUI 13/14 may require ADB |
| ADB-background | β | β | β | MIUI 14 is blocked without root |
| Editing package_restrictions.xml | β | β | β | Requires root or magisk |
| Shizuku's use of | β | β | β | It only works on Android 11+. |
π‘
On MIUI 14, most of the βcircumventionβ methods have stopped working due to tighter security policies. If your device is upgraded to this version, consider rolling back MIUI 13 or using root rights.
Frequent Mistakes and How to Avoid Them
When setting up the background work, users often make the following mistakes:
- π Do not check permissions after updating MIUI β After major updates, all settings are reset.
- π΄ Disable notifications to save battery β without notifications MIUI considers the application "inactive" and closes it.
Another common problem is conflict with other SEOs.
- Greenify β Make sure the app is not added to the βfreezeβ list.
- AccuBattery β Disable Charging Limitation, as it can block background tasks
- Tasker or MacroDroid β Check if there are any rules that force apps to close.
On devices with MIUI Global (e.g. Xiaomi 13 Lite), some settings may not be available due to regional restrictions.
- Install MIUI EU (unofficial firmware with advanced settings).
- Using XiaomiADBFastbootTools to unlock hidden features.
β οΈ Note: On models for the Chinese market (Xiaomi) 12S Ultra, Redmi K50) Some battery settings are locked without being tied to your Mi Account. To unlock them, you will need to change the firmware region or use root.