| title | Phantom Process Killer |
|---|---|
| description | Fix Android 12+'s aggressive background process termination that kills Termux. |
Android 12 introduced the Phantom Process Monitor β it aggressively kills background processes. Your OpenClaw gateway and Termux sessions are at risk.
Symptom:
[Process completed (signal 9) - press Enter]
Go to Settings β About Phone β tap Build Number 7 times.
Settings β Developer Options β USB Debugging. Connect phone to PC.
adb devices # verify connection
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent"
adb shell "/system/bin/device_config put activity_manager max_phantom_processes 2147483647"adb shell "/system/bin/device_config get activity_manager max_phantom_processes"
# Output: 2147483647- Go to Settings β Developer Options β Wireless Debugging
- Note the IP:Port shown
- In Termux:
pkg install android-tools
adb connect 192.168.1.x:PORT
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent"
adb shell "/system/bin/device_config put activity_manager max_phantom_processes 2147483647"Shizuku provides ADB-level access without a PC. Install from Play Store, activate, then run the commands via a Shizuku-compatible terminal.
Always run inside tmux β even if the terminal window dies, the tmux session survives:
tmux new -s openclaw
openclaw start
# Ctrl+B, D to detach
# tmux attach -t openclaw to re-attach