Android OS App Killing Troubleshooting
Diagnosing when the Android operating system terminates Xopoz GPS tracking
⚠️ Important Notice
This is NOT a Xopoz software issue. Modern Android devices, especially those from manufacturers like Huawei, Samsung, and Xiaomi, use aggressive power management that can terminate background apps regardless of proper configuration.
Understanding the Problem
When Xopoz GPS tracking stops unexpectedly, it's often because the Android operating system has terminated the app's background processes. This happens due to:
- Aggressive Power Management: Manufacturers like Huawei (EMUI), Samsung, and Xiaomi implement custom battery optimizations
- App Standby Buckets: Android categorizes apps based on usage patterns and kills "rarely used" apps first
- Memory Pressure: System kills background apps when device memory is low
- Custom OS Behavior: Manufacturer-specific Android modifications override standard battery whitelist settings
Diagnostic Protocol
Follow these steps to confirm if your app has been killed by the operating system. You'll need a computer with ADB (Android Debug Bridge) installed and USB debugging enabled on your phone.
1Check if Xopoz is Currently Running
adb shell ps | grep com.tbr.xopoz
Example Output Analysis:
✅ App Running (Normal)
u0_a388 12345 1234 1234567 12345 0 0 S com.tbr.xopoz
Meaning: Xopoz process is active and running normally.
❌ App Killed (Problem)
(No output - empty result)
Meaning: Xopoz process is not running - the OS has terminated it.
2Check System Stop Status
adb shell dumpsys package com.tbr.xopoz | grep stopped
Example Output Analysis:
❌ System Stopped App
User 0: ceDataInode=216673 installed=true hidden=false suspended=false stopped=true notLaunched=false enabled=0 instant=false virtual=false
Key Finding: stopped=true confirms the Android system has officially stopped the app.
Meaning: This is definitive proof the OS terminated Xopoz, not a software bug.
✅ App Not Stopped by System
User 0: ceDataInode=216673 installed=true hidden=false suspended=false stopped=false notLaunched=false enabled=0 instant=false virtual=false
Key Finding: stopped=false means the system hasn't officially stopped the app.
3Check Recent Kill Events
adb logcat -d | grep -i "kill.*com.tbr.xopoz"
Example Output Analysis:
❌ Kill Events Found
ActivityManager: Killing 12345:com.tbr.xopoz/u0a388 (adj 906): remove task
ActivityManager: Killing 12345:com.tbr.xopoz/u0a388 (adj 906): memory pressure
Meaning: System logs show explicit kill commands due to memory pressure or task removal.
ℹ️ No Recent Kill Events
(No output - empty result)
Meaning: No explicit kill events in current log buffer (may have been cleared or happened earlier).
Advanced Diagnostics
Check Battery Whitelist Status
adb shell dumpsys deviceidle whitelist | grep com.tbr.xopoz
Example: Properly Whitelisted
Meaning: App is whitelisted for battery optimization, but manufacturer-specific power management can still kill it.
Check App Usage Bucket
adb shell dumpsys usagestats | grep com.tbr.xopoz | tail -1
Example: App in "Rare Usage" Bucket
package=com.tbr.xopoz u=0 bucket=5 reason=d used=+1h58m5s810ms usedScr=+33m25s839ms lastPred=+67d14h17m3s697ms activeLeft=-58m5s810ms wsLeft=+10h1m41s928ms lastJob=-24855d3h14m7s652ms idle=n
Critical Finding: bucket=5 means the app is in the "rarely used" category.
Impact: Apps in bucket 5 are first targets for termination, even if whitelisted.
Manufacturer-Specific Issues
Huawei/Honor Devices (EMUI/HarmonyOS)
Known Issue: EMUI is extremely aggressive with background app management, often ignoring standard Android battery whitelist settings.
Required Settings:
- Battery Settings: Settings → Battery → App Launch → Xopoz → Manual Management → Enable all options
- Protected Apps: Settings → Battery → Protected Apps → Enable Xopoz
- Power Management: Settings → Apps → Xopoz → Battery → "No restrictions"
- Auto-Start: Phone Manager → Auto-Start → Enable Xopoz
Samsung Devices
- Device Care: Settings → Device Care → Battery → App Power Management → Apps that won't be put to sleep → Add Xopoz
- Optimize Settings: Settings → Apps → Xopoz → Battery → Optimize battery usage → "Don't optimize"
Xiaomi Devices (MIUI)
- Autostart: Security → Autostart → Enable Xopoz
- Battery Saver: Settings → Battery & Performance → App Battery Saver → No restrictions
Verification Steps
After making the above changes, verify the settings worked:
adb shell dumpsys package com.tbr.xopoz | grep stopped
Should show stopped=false after restarting Xopoz.
Important Notes
🔍 Key Takeaways
- Not a Bug: App killing by OS is normal Android behavior for power management
- Manufacturer Override: Custom Android skins can ignore standard whitelist settings
- Usage Patterns: Apps need regular user interaction to maintain higher priority buckets
- Multiple Settings: Often requires configuring several different power management settings
✅ Best Practices
- Open Xopoz daily to maintain usage score
- Check notification area for "Xopoz GPS Tracking" persistent notification
- Configure ALL manufacturer-specific power management settings
- Consider keeping phone plugged in for critical long-term tracking
Technical Summary
| Diagnostic Command |
What It Shows |
Problem Indicator |
ps | grep com.tbr.xopoz |
Current running processes |
No output = process killed |
dumpsys package | grep stopped |
Official system stop status |
stopped=true = OS terminated app |
logcat | grep kill.*xopoz |
Explicit kill events in logs |
Kill messages = forced termination |
usagestats | grep xopoz |
App usage bucket classification |
bucket=5 = rarely used (high kill risk) |
⚠️ Final Reminder
If your diagnostic shows stopped=true or bucket=5, this confirms the issue is with Android's aggressive power management, not Xopoz software. The app is functioning correctly but being terminated by the operating system's background process management.