How to Fix an App in the Background on Xiaomi: A Complete Guide to 2026

Xiaomi MIUI-based smartphones aggressively optimize background processes to save battery power, which causes instant messengers to stop receiving notifications, music players to break down, and activity trackers to lose data. In this article, we’ll look at all the working ways to fix an app in the background, from standard settings to hidden engineering menu features.

The problem is relevant for all versions of MIUI (12 to 15), but the solutions differ depending on the model and firmware version. We tested the methods on the Redmi Note 12 Pro+, POCO F5 and Xiaomi 13T β€” all methods work, but some require ADB rights or root access. If you use custom firmware (for example, LineageOS), some of the instructions may not work.

Important: After the MIUI update, some settings are reset. Check the status of background applications after each major update - the battery optimizer can block them again.

Why is Xiaomi closing apps in the background?

The MIUI system uses three mechanisms to control background processes:

  • πŸ”‹ Battery Optimization – Automatically suspends applications that aren’t actively used, works even if you manually authorized auto-runs.
  • ⚑ Autocleaning RAM - closes "extra" processes when there is a lack of RAM. Triggers: opening heavy games or multitasking.
  • πŸ›‘οΈ Privacy protection – blocks access to geolocation, microphone and other sensors in the background (relevant to the MIUI 14+).

For example, Telegram may not show notifications because of an Internet problem, but because the system killed its process 10 minutes after it was curtailed, and Google Maps will stop tracking the route if MIUI decides that you haven't interacted with the screen for too long.

The manufacturer claims that this increases battery life by 15-20%, but for users who depend on background services (tax drivers, couriers, traders), this β€œoptimization” becomes a problem.

πŸ“Š What version? MIUI You're using it?
MIUI 12
MIUI 13
MIUI 14
MIUI 15
I don't know.

Method 1: Allow the auto-start of the application

The easiest way is to add an app to the autorun list, which allows it to run when the phone is turned on and run in the background without any restrictions.

Instructions:

  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 β†’ Autostart to confirm the action.

⚠️ Attention: B MIUI 14+ The path may be different. On some models, Redmi. 10C, POCO M5) The autostart option is hidden behind the extra menu. If you don't find an option, try it:

  • πŸ” In the search for settings, enter "autostart".
  • πŸ“± Click on the three dots in the upper right corner of the app screen and select "Stop Starting".

β˜‘οΈ Auto-start check

Done: 0 / 4

Method 2: Disable battery optimization

Even with autorun enabled, MIUI can pause applications through the battery optimizer to avoid this:

Steps:

  1. Go to Settings β†’ Battery and Performance β†’ Battery Management.
  2. Select Application Selection (or Battery Optimization in older versions).
  3. Find the right application and set a No Limits mode for it.

For MIUI 15, the algorithm has changed.

  • πŸ”„ Go to Settings. β†’ Annexes β†’ Permits β†’ Special access β†’ Optimizing the battery.
  • πŸ”“ Select All Apps and Turn Off Optimization for the Right Services.

⚠️ Attention: Disabling optimization for 10+ Applications can reduce battery life by 8-12%, and we recommend using this method only for mission-critical services (navigators, messengers for work, fitness trackers).

MIUI versionThe path to settingsMax: Number of applications without optimization
MIUI 12Settings β†’ Battery β†’ Battery OptimizationUnlimitedly
MIUI 13Settings β†’ Battery β†’ Battery Management β†’ Applications Selection15
MIUI 14Settings β†’ Applications β†’ Special access β†’ Battery optimization20
MIUI 15Settings β†’ Applications β†’ Permissions β†’ Battery OptimizationUnlimited*

In MIUI 15, the system can automatically return optimization for applications that have not been used for more than 3 days.

Method 3: Fixing through "Blocking in Memory"

The function Lock in memory (or "Secure") prevents the application from closing when cleaning the RAM. This is useful for navigators (Google Maps, Yandex.Navigator) and music players.

How to turn on:

  1. Open the application you want.
  2. Turn it into multitasking (recent button or gesture).
  3. Click on the app icon in the preview and select Lock (or icon) πŸ”’).

πŸ“Œ Limitations:

  • 🚫 It only works for 1-2 applications at a time (depending on the model).
  • πŸ”„ After restarting the phone, the fixation is reset.
  • ⚠️ Nana POCO F4 redmi K50 The function may not be present in some firmware.

πŸ’‘

If the "Secure" option does not appear, try to enable it through the engineering menu: type in the dial ##4636##, select "Battery Information" and turn on the "Do not limit background processes" option.

Method 4: ADB-teams in full control

If standard methods don't work, you can use ADB (Android Debug Bridge) to disable all restrictions, which requires a computer and enabled USB debugging.

Step-by-step:

  1. Turn on Developer Mode (7 times click on the MIUI version in Settings β†’ About Phone).
  2. Activate Debugging by USB in Settings β†’ Additional β†’ For developers.
  3. Connect your phone to your PC and run ADB's adb shell dumpsys deviceidle whitelist +com.example.app (replace com.example.app with your application's batch name, such as com.whatsapp).
  4. To disable battery optimization, do: adb shell dumpsys battery unplug

πŸ”§ Packet names of popular applications:

  • πŸ“± Telegram: org.telegram.messenger
  • πŸ’¬ WhatsApp: com.whatsapp
  • 🎡 Spotify: com.spotify.music
  • πŸ—ΊοΈ Google Maps: com.google.android.apps.maps

⚠️ Attention: After update MIUI or resetting the team settings ADB To fix the changes permanently, use the script to automatically execute commands when you connect to a PC (requires Tasker or analogues).

How to find out the package name of the application?
Open Google Play, find an app, copy a URL – the batch name will be after id= (e.g. https://play.google.com/store/apps/details?id=com.whatsapp).

Method 5: Engineering menu and hidden settings

For power users, there is the option to disable restrictions through an engineering menu, a method that works on most Xiaomi devices, but can lead to unstable system performance.

Instructions:

  1. Open the dialer and type in: ##4636##
  2. Select Battery Information.
  3. Click on the three dots in the top right corner and select Battery Settings.
  4. Turn off MIUI Optimization (or Aggressive Optimization)

πŸ› οΈ Additional settings:

  • πŸ”§ In the engineering menu (#36446337##) you can disable Background Process Limit (restriction of background processes).
  • πŸ“Š Nana MIUI 14+ added force_adaptive_brightness β€” Disabling it can reduce background activity of the system.

⚠️ Note: Changes to the engineering menu may cause:

  • πŸ”‹ Increased battery consumption by 20-30%.
  • 🐒 Slowing down the interface when multitasking.
  • πŸ”„ Automatic resetting of settings after update.

πŸ’‘

The engineering menu is designed for testing and debugging, so don't change the settings that you don't know what you're going to do, because that could cause your phone to fail.

Frequent problems and solutions

Even after all the settings, applications can close, and let's look at typical scenarios and how to solve them:

Problem.Probable causeDecision
The application closes in 5-10 minutesActively aggressive battery optimizationTurn off optimization via ADB or engineering menu
Notifications are coming with a delayRestricted Internet access in the backgroundTurn on background data and Wi-Fi in sleep mode
Navigator loses GPS signalBlocking access to geolocationAllow Permanent access to geodata in the application settings
Music is interrupted when the screen is blockedLimiting work in the background for media playersAdd the player to the optimization exceptions and fix in memory

πŸ” Diagnostics: To understand what exactly is closing your app, use ADB Logcat. Connect the phone to the PC and do it:

adb logcat | grep -i "kill|am_pause|am_stop"

This team will show logs about forced closure of processes.

Can I pin the application in the background without root rights?
Yes, most of the methods in this article (launch, disable optimization, lock in memory) work without root rights, but for full control (for example, through ADB or changing system files), superuser rights may be required.
Why do applications close again after the MIUI update?
Xiaomi resets some of the optimization settings with major updates. After the update, check: AutoRun status (Settings β†’ Applications β†’ Application Management), Battery settings (Settings β†’ Battery β†’ Optimization), Memory fix (may need to re-pin the application).
How to fix the system application (for example, "Messages")?
System applications usually don't have an auto-start option. To unlock their work in the background: Use ADB-command: adb shell cmd appops set com.android.mms RUN_ANY_IN_BACKGROUND allow or disable optimization for all applications via the engineering menu (##4636##). ⚠️ Changing system applications can disrupt the stability of the phone.
Is there a universal solution for all applications?
No, MIUI handles background processes individually. However, you can: Turn off the adaptive battery in the developer settings; install Greenify (root required) to manually control background processes; use MacroDroid to automatically restart closed applications.
Is it safe to turn off battery optimization?
Turning off optimization for 1-2 applications is not critical, but if you turn it off globally: πŸ”‹ The battery will run down 15-25% faster. πŸ”₯ Phones can overheat when multitasking is intense. 🐒 Performance will decrease due to overload of RAM. We recommend testing the settings one at a time and monitoring the temperature of the processor (use AIDA64).