Developers working with Xiaomi devices based on MIUI or HyperOS face unique challenges: aggressive battery optimization kills background processes, pre-installed services interfere with debugging, and system restrictions block access to critical APIs. This article is not about βaccelerating a smartphone for gamesβ β here are specific recommendations for developers who want to gain full control of the device, disable interfering functions and set up an environment for testing, debugging or customization.
We'll look at not only the obvious things like MIUI Optimization, but the hidden settings that Xiaomi's documentation doesn't mention, like why disabling mipush can save your adb logcat from lag, or how to properly deactivate Game Turbo so it doesn't interfere with performance benchmarks. All of the instructions are tested on devices with HyperOS 1.0+ and MIUI 14/13, but most of them are valid for older versions as well.
Warning: Some changes will require unlocking the bootloader or root rights. If you are not ready, skip the relevant sections. Also remember that disabling system services can disrupt branded features (for example, Quick Apps or Xiaomi Cloud).
1. Battery Optimization: Why Your App Dies in the Background
The battery optimization system in MIUI/HyperOS is the developer's main enemy: it aggressively closes the background, blocks WorkManager, kills services through doze-mode, and ignores Foreground Service. Even if you set up AndroidManifest.xml correctly, Xiaomi can ignore your flags.
To disable optimization for a particular application:
- Go to Settings β Applications β Application Management.
- Select your application β Battery Limits.
- Set up a No Limits mode.
- Enable AutoRun and Block in the background (yes, itβs against logic, but thatβs how MIUI works).
For global optimisation disabling (ADB required):
adb shell dumpsys deviceidle force-idle
adb shell settings put global hidden_api_policy 1β οΈ Warning: After the global optimisation shutdown, the battery will run down 15 to 30 percent faster. Use this method only on test devices.
π‘
If your app is still getting killed, check the adb shell dumpsys activity processes log. Often the problem lies in the limitations of AppOps, which are not visible in the standard interface.
2.Mipush and msa services: hidden resource eaters
Two system services, com.xiaomi.mipush.sdk and com.miui.msa.global, are constantly in memory, sending analytics and preventing debugging: One is responsible for push notifications (including spam from Mi Browser), the other is for telemetry collection, and both can block network requests from your application if they consider them βsuspicious.β
You can turn them off in two ways:
- π§ Through ADB (no root): adb shell pm disable-user --user 0 com.xiaomi.mipush.sdk adb shell pm disable-user --user 0 com.miui.msa.global
- π οΈ Through Magisk (with root): Use the DisableMIUI module or remove APK via Root Explorer.
After the shutdown:
- β Notifications from Xiaomi (advertising, updates) will stop coming.
- β Logcat lags will disappear due to mipush background activity.
- β οΈ Some Mi Account features (e.g., device search) will stop working.
How to check if the services are actually disabled?
Game Turbo and Acceleration of Games: Why They Are Getting In the Way of Benchmarks
Game Turbo is not just a βmode for gamesβ, but a whole range of optimizations that:
- Blocks background processes (including your test services).
- Limits the clock speed of the CPU/GPU if it considers the application to be βnon-gameβ.
- It replaces the screen resolution (even if you explicitly set 1080p in the settings).
To turn off Game Turbo:
- Go to Settings β Special features β Game Turbo.
- Turn off the game speed slider.
- Remove all games from the list of βOptimized Appsβ.
- Through ADB, execute: adb shell pm uninstall --user 0 com.miui.gameturbo
For complete removal (root required):
su
mount -o rw,remount /system
rm -rf /system/priv-app/GameTurbo
rm -rf /system/app/GameTurbo
mount -o ro,remount /system4. pre-installed applications: what can be safely removed
Xiaomi is clogging devices with unnecessary apps that:
- They're in /system.
- They consume battery and traffic in the background.
- They may conflict with your test builds (e.g., Mi Browser intercepts WebView).
List of safe applications to remove (via ADB):
| Package | Annex | Effects of removal |
|---|---|---|
| com.miui.browser | Mi Browser | You lose your browser by default, but WebView will stay. |
| com.miui.analytics | MIUI Analytics | Data on the use of the device will cease to be sent. |
| com.xiaomi.midrop | Mi Drop | You will not be able to use proprietary file transfer. |
| com.miui.videoplayer | Video player | We'll have to use a third-party player. |
| com.miui.notes | Notes | You will lose sync with Mi Cloud. |
Remove the command (replace [package] with the desired package):
adb shell pm uninstall --user 0 [package]β οΈ Warning: Do not delete com.android.vending (Google Play) or com.google.android.gsf, this will result in loss of functionality of Google Services.
5. AppOps Limitations: Why Your App Doesn't Get Permissions
Even if the user has given all permissions manually, MIUI/HyperOS can block them through the hidden AppOps manager.
- Your app has requested ACCESS_FINE_LOCATION, but no coordinates are coming.
- The camera works, but does not save the photo to the gallery.
- NotificationListener does not catch notifications.
To check and reset the restrictions:
- Install AppOps from Rikka.
- Find your app and check the resolution status (e.g. Android:location should be ALLOWED).
- If IGNORED or DENIED status, reset via ADB: adb shell cmd appops reset [package]
For global reset (caution!):
adb shell cmd appops set [package] android:location ALLOW
adb shell cmd appops set [package] android:read_external_storage ALLOWInstall AppOps Explorer | Find your application package | Check the status of critical resolutions (location, camera, storage) |Reset restrictions through ADB (if necessary)
-->
6.MIUI Optimization: The Hidden Performance Killer
MIUI Optimization (called System Optimization) is responsible for:
- Limiting background processes (even for root applications)
- Switching animations and transitions (interfering with UI testing).
- Block changes to /system (for example, if you are trying to replace build.prop).
It is only disabled via ADB:
adb shell settings put global miui_optimization 0After the shutdown:
- β The limit of background processes will increase (from 4-8 to 16+).
- β Developer settings will stop resetting after the reboot.
- β οΈ Lags may appear in a standard launcher (MIUI Launcher is not optimized to operate without this feature).
π‘
Disabling MIUI Optimization is a must if you are working with Xposed, Magisk or modifying system files.
7 Developer settings: what to enable and what to disable
The Settings β About Phone β MIUI version (7 taps to unlock) has hidden options critical to development, but some of them are better off to avoid problems:
- π« Do not turn off the screen when charging interferes with testing sleep patterns.
- π« Enable the HCI Bluetooth log β clogs memory with logs.
- β Debugging according to USB (safe) is mandatory for ADB.
- β Do not turn off Wi-Fi when sleeping - you need to test background tasks.
- π« Accelerated animation (0.5x) β distorts the actual response time UI.
It is also useful to include:
adb shell settings put global development_settings_enabled 1
adb shell settings put global stay_on_while_plugged_in 0This will open up access to hidden options, such as:
- Force GPU Rendering β for graphics testing.
- Disable HW Overlays β if you debug SurfaceView
- Show CPU Usage β for load monitoring.
8. Knockoff and other security features that interfere with debugging
Xiaomi adds undocumented security mechanisms to the firmware that:
- Block ADBs through certain ports.
- Interrupt the ADB Wi-Fi connection after 5 minutes of inactivity.
- You can not install APK via adb install if the file is not downloaded from Google Play.
To circumvent these restrictions:
- Disable Knockoff (Unauthorized Access Protection Mechanism): adb shell settings put global knockoff_feature_enabled 0
- Wi-Fi ADB: adb shell settings put global adb_wifi_auto_disable 0
- Allow installation from any source: adb shell settings put global install_non_market_apps 1
β οΈ Warning: Disabling Knockoff reduces protection against attacks via ADB. Use only on test devices not connected to public networks.