Skip to content

Latest commit

Β 

History

History
74 lines (53 loc) Β· 1.88 KB

File metadata and controls

74 lines (53 loc) Β· 1.88 KB
title Phantom Process Killer
description Fix Android 12+'s aggressive background process termination that kills Termux.

What is it?

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]

Fix via ADB (Recommended)

Step 1 β€” Enable Developer Options

Go to Settings β†’ About Phone β†’ tap Build Number 7 times.

Step 2 β€” Enable USB Debugging

Settings β†’ Developer Options β†’ USB Debugging. Connect phone to PC.

Step 3 β€” Run ADB commands (on 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"

Step 4 β€” Verify

adb shell "/system/bin/device_config get activity_manager max_phantom_processes"
# Output: 2147483647
This setting persists across reboots. One-time setup.

Fix via Wireless ADB (No USB cable, Android 11+)

  1. Go to Settings β†’ Developer Options β†’ Wireless Debugging
  2. Note the IP:Port shown
  3. 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"

Fix via Shizuku

Shizuku provides ADB-level access without a PC. Install from Play Store, activate, then run the commands via a Shizuku-compatible terminal.


tmux as a failsafe

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