How to make the application work in the background on Xiaomi: all the ways

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.

πŸ“Š What kind of Xiaomi model do you have?
Redmi Note 10/11/12
Xiaomi 11/12/13/14
POCO F3/F4/F5
Another model

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.

  1. Open Settings β†’ Applications β†’ Application Management.
  2. Select the desired application (for example, WhatsApp or Yandex.Navigator).
  3. Slip on Autostart and switch on the switch.
  4. Go back and click Permissions β†’ Additional β†’ Show float windows (for some applications).

If AutoRun is not in the app menu, try an alternative path:

  1. Go to Settings β†’ Battery and Performance β†’ Battery Management.
  2. Choose App Choices (or Battery Optimization in Newer Versions).
  3. 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 β†’ AutoRun

Auto-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:

  1. Open Settings β†’ Battery and Performance β†’ Battery Management
  2. Select Application Choice (or Battery Optimization in MIUI 14).
  3. Find your app in the list and set the No Limits mode.
  4. 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 Limits

Some 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?
Some models (e.g. Xiaomi Mi) A3 Android One, instead of "No restrictions" will be "No optimizing." Select it. If you don't have that, use it. ADB-Adb shell dumpsys deviceidle whitelist +com.package.name where com.package.name is the batch name of the application (you can find out through the App Inspector in Google Play).

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.

  1. Turn on Developer Mode: Settings β†’ About Phone β†’ MIUI Version (shap 7 times)
  2. Activate debugging over USB: Settings β†’ Additional β†’ For developers β†’ Debugging over USB
  3. Connect your phone to the PC and use it ADB-team.

Mainstream ADB-teaming:

Team team.DescriptionExample
adb shell cmd appops set <packet> RUN_ANY_IN_BACKGROUND allowAllows work in the background for any processadb shell cmd appops set com.whatsapp RUN_ANY_IN_BACKGROUND allow
adb shell dumpsys deviceidle whitelist +<pack>Excluding Doze from the regimeadb shell dumpsys deviceidle whitelist +org.telegram.messenger
adb shell settings put global hidden_api_policy 1Unlocks 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.

  1. Enable Developer Mode (see above).
  2. Activate the option Do not turn off the screen while charging:
  3. 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:

MethodMIUI 12MIUI 13MIUI 14Notes
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.

  1. Install MIUI EU (unofficial firmware with advanced settings).
  2. 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.

FAQ: Answers to Frequent Questions

Why do applications close in the background again after the MIUI update?
MIUI Resets all background permissions after major updates. You need to re-enable autostart; disable battery optimization; check notification permissions. MIUI 12 on MIUI 14, some settings may have disappeared altogether - use ADB-team.
How to find out the package name of the application for ADB-team?
There are several ways: through Google Play: open the app page in your browser - the name of the package is indicated in the URL (for example, com.whatsapp for WhatsApp); through App Inspector (an app from the Play Market); through ADB: adb shell pm list packages | grep "name"
Can I turn off battery optimization for all applications at once?
No, MIUI It doesn't provide that function. You have to manually configure each application. ADB-script for automatic application of commands to all necessary packages: for app in com.whatsapp org.telegram.messenger; do adb shell cmd appops set $app RUN_ANY_IN_BACKGROUND allow adb shell dumpsys deviceidle whitelist +$App done List of applications (com.whatsapp org.telegram.messenger) replace your own.
Does disabling MIUI Optimization help?
Partially. This feature is responsible for intelligent resource management, but even after it is turned off, the Android Doze restrictions will remain. Fully remove background restrictions only with root rights or through ADB (see compatibility table above). To disable MIUI Optimization: Settings β†’ About Phone β†’ MIUI Version (tap 5 times) β†’ Additional β†’ MIUI Optimization (disable)
Why do music players (Spotify, VK Music) stop in the background?
For music applications, you need to: Allow AutoRun; Turn off battery optimization; Enable Background Play in the player settings; Add the app to the Memory Cleanup exceptions. If the problem persists, try alternative players (Poweramp, Musicolet), which are better adapted to work on MIUI.