Skip to content

// guides

Fix Termux Process Completed (Signal 9) on Android

If Termux dies with [Process completed (signal 9) - press Enter] in the middle of a job, that is the Android 12+ phantom process killer, not a Termux bug. Android kills background ("phantom") processes once the system-wide count passes 32, or when one uses heavy CPU. The fix depends on your Android version: on Android 14+ flip a Developer Options toggle; on Android 12, 12L, and 13 run one ADB command; on rooted phones use su. We cover all three below, then the honest catch: even fixed, a long AI agent session is the workload most likely to get killed.

This guide was written by the Cosyra team. We hit signal 9 ourselves running a long agent session in Termux on an Android 14 phone, and we cross-checked every command against Termux issue #2366 and the fix steps on Ivon's Blog, verified 2026-06-10.

The one thing to understand first: signal 9 is not Termux crashing. It is Android deciding your terminal has too many background processes and sending SIGKILL. That means the real fix is an Android setting, not a Termux setting, and which setting you can reach depends entirely on your Android version.

Jump to your fix. The steps differ by Android version:

  • Android 14 or newer: a Developer Options toggle, no computer needed. Disable child process restrictions.
  • Android 12, 12L, or 13: one ADB command from a computer. Run the ADB fix.
  • Rooted phone: the same command locally, no computer. Run it with su.
  • Running long Claude Code or Codex CLI sessions? Read the honest catch first. The toggle widens the limit, but it does not delete the mechanism, and a system update can turn it back on.
Decision diagram for the Termux signal 9 error: the [Process completed (signal 9) - press Enter] message is caused by the Android 12+ phantom process killer, which kills background processes past a count of 32 or under heavy CPU. The fix differs by version: Android 14+ has a Developer Options toggle called Disable child process restrictions; Android 12, 12L, and 13 require an ADB command to set settings_enable_monitor_phantom_procs to false; rooted devices run the same command with su. A caveat notes a system update can reset it and the limit still exists. The bottom path shows a cloud Ubuntu container is not Android, so the phantom killer does not exist there and a long agent keeps running while the phone is locked.
The signal 9 error, its cause, the per-version fix, and the container path that never hits it. Diagram, verified 2026-06-10 against Termux issue #2366 and the published ADB fix commands.

What signal 9 actually is

Signal 9 is SIGKILL, the signal a process cannot catch or ignore. When the Android OS sends it, the process is gone immediately, and Termux reports the shell child died with [Process completed (signal 9) - press Enter]. So the message is accurate but misleading: nothing in Termux failed. Something outside Termux reached in and killed the process.

On Android 12 and newer, that something is almost always the phantom process killer. Android 12 added a monitor that counts background child processes across the whole system and kills them once the count passes a default of 32, and it also targets processes burning CPU in the background. The Termux README warns about exactly this, and the long-running tracking issue #2366 collects hundreds of reports of the same error.

termux on android 14, the moment it dies

$ python train.py --epochs 50

epoch 1/50 ...

epoch 2/50 ...

[Process completed (signal 9) - press Enter]

The fix, by Android version

There is no single command that works everywhere, and that is the source of most of the confusion online. What you can do depends on your Android version. Pick the section that matches your phone.

Android 14 and newer: the Developer Options toggle

This is the easiest path and needs no computer. Turn on Developer Options first: open Settings, go to About phone, and tap Build number seven times. Then open Settings, Developer Options, and enable Disable child process restrictions. Reboot. That toggle is Google's own switch for this behavior, and it is the cleanest fix when your device exposes it.

Android 12, 12L, and 13: ADB from a computer

These versions have no toggle, so you change the setting over ADB. Enable USB debugging (same Developer Options menu), connect the phone to a computer with the platform-tools installed, and run the commands below. The first tells the OS to stop monitoring phantom processes.

On Android 12 you also have to raise the phantom-process ceiling, and the order matters. That ceiling lives in device_config, which Google Play Services re-syncs from the server roughly three to four minutes after the device boots and unlocks. If you set the limit without disabling that sync first, the value is silently reverted while you are still waiting for your build to finish, and signal 9 comes back with no visible cause. Run set_sync_disabled_for_tests persistent before the put, not after.

on your computer, with the phone connected over adb

$ adb shell settings put global settings_enable_monitor_phantom_procs false

# Android 12 only, and in this order:

$ 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

# then reboot the phone

Reboot after running them. If signal 9 comes back later, the two likely causes are a system update that reset the setting, or a device_config value you set without the sync-disable step above. Reapply the commands in the order shown. This is documented in the Android process behavior notes maintained by a Termux maintainer, phantom, cached and empty processes (verified 2026-07-23).

Rooted devices: run it locally with su

If your phone is rooted you can skip the computer and set the same flag from inside Termux. Run the command, approve the root prompt, and reboot.

inside termux on a rooted phone

$ su -c "settings put global settings_enable_monitor_phantom_procs false"

# grant root, then reboot

If you are on Android 12 and also raising max_phantom_processes with su, the same ordering rule applies: run su -c "/system/bin/device_config set_sync_disabled_for_tests persistent" first, or Play Services will re-sync the value away after your next reboot.

The honest catch for long agent sessions

Disabling the monitor widens the limit; it does not delete the mechanism, and both a system update and a Play Services device_config re-sync can quietly turn it back on. For most uses (an ssh session, a quick script) that is fine. For the workload people increasingly want from a phone terminal, running an AI coding agent for half an hour while they do something else, it is shakier. An agent session is a long-lived, CPU-active process, which is the exact profile the phantom killer was built to target — and so is a test suite spawning workers, which is why running tests from your phone hits the same wall. We have watched a perfectly-configured Android 14 phone still kill a long Claude Code on Termux run when it backgrounded the app to save battery on the train.

The usual advice at this point is to wrap the run in tmux so it detaches instead of dying. That does not help here, because the killer takes the tmux server process too, the same [Process completed (signal 9)] line, one layer down. The fixes on this page are what keep a tmux session alive on Android; the tmux on your phone guide covers the session-level setup itself.

Vendor documentation rarely warns you about this, even when the vendor has gone to the trouble of writing Termux docs at all. Pi is the clearest example: its Termux install is officially supported and lists three limitations honestly, none of which is the phantom process killer that actually ends long agent runs.

The opinion we hold that the local-first crowd will push back on: for an agent you want to keep working while your phone is in your pocket, fighting the OS scheduler is the wrong layer to solve this at. The process should not live on the phone at all. That is the design choice behind Cosyra, and it is worth being upfront that it trades away offline use to get there.

Why a cloud container never throws signal 9

The phantom process killer is an Android feature. It does not exist on desktop Linux, and it does not exist in a cloud Linux container. A Cosyra workspace is a per-user Ubuntu 24.04 x86_64 container on Azure AKS, reached from a native Android or iOS app. Because it is real Linux and not Android, there is no 32-process limit and no SIGKILL from a phantom monitor. A long agent run keeps going while your phone is locked, and when you put the phone down the container hibernates and resumes where it left off rather than dying.

The other practical difference is the ABI. Termux is an aarch64 Android userland, so some prebuilt binaries and native packages do not run without workarounds. That bites hardest in the npm ecosystem, where an addon without an arm64 prebuild has to compile from source, the failure mode we walk through in running Node.js on your phone. A container is x86_64 Ubuntu, so standard Ubuntu tooling installs unmodified. We pre-install Claude Code, Codex CLI, OpenCode, and Gemini CLI so an agent is one command away rather than an install fight. For the fuller comparison of the two approaches, see Cosyra vs Termux, and for the range of ways to get a real Linux userland onto Android, including the proot-distro route that has its own phantom-killer exposure, see Android Linux container options.

cosyra on android, the same long job that survives

Ubuntu 24.04.1 LTS (x86_64), not Android

$ claude

> refactor the auth module and run the suite

(phone locked 18 min, session still running)

edited 6 files · ran pytest · 92 passed

Want a phone terminal that never throws signal 9? A Cosyra container is real Ubuntu, not Android, so there is no phantom killer. Claude Code, Codex CLI, OpenCode, and Gemini CLI come pre-installed. 1 hour free on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more. Google Play / App Store / Pricing details

Who should fix Termux, and who should move off-device

Fix Termux in place if you want a free, local, offline-capable terminal and your phone exposes the Android 14+ toggle (or you are comfortable with ADB). For short interactive work that is the right tool, and it keeps working with no signal. Stay with it especially if offline matters, because a cloud container needs a connection and Termux does not, which we say plainly in the mobile coding terminal guide.

Move the work off the device if your main use is long-running agent sessions, if you are on Android 12 or 13 with no computer for ADB, or if you are tired of a setting that an OS update can silently reset. At that point the container is not a workaround for signal 9, it is a setup where the error category does not exist.

Frequently asked questions

What does "[Process completed (signal 9) - press Enter]" mean in Termux?

Signal 9 is SIGKILL: the Android OS force-killed the process Termux was running, and Termux prints "[Process completed (signal 9) - press Enter]" when its shell child dies that way. On Android 12 and newer the usual cause is the phantom process killer, which kills background processes once the system-wide count passes 32 or when a process uses excessive CPU. A long build or AI agent session is exactly the workload it targets. A cargo release build is among the worst cases, since it spawns one compiler process per crate and holds the CPU for minutes; we cover that pattern in Rust on Termux.

Why did Termux start crashing after I upgraded to Android 12, 13, or 14?

Android 12 introduced phantom process monitoring. Before that, on Android 11 and earlier, Termux could run background processes indefinitely. After the upgrade the OS started killing "phantom" child processes, so the same scripts that ran for hours now die with signal 9. The Termux README carries a prominent warning that it may be unstable on Android 12 and newer for this reason.

How do I disable the phantom process killer without root or a PC?

Only on Android 14 and newer, which added a Developer Options toggle. Enable Developer Options, then turn on "Disable child process restrictions" and reboot. On Android 12, 12L, and 13 there is no toggle, so you need ADB from a computer (or root). That version gap is the single most common reason the fix that worked for someone else does not appear on your phone.

Will the signal 9 fix survive a reboot or a system update?

It depends which knob you turned. The Developer Options toggle and the settings_enable_monitor_phantom_procs flag survive a normal reboot, and on most devices you reboot to make them take effect. The Android 12 device_config limit is the one that catches people out: Google Play Services re-syncs device_config from the server about three to four minutes after the device boots and unlocks, which silently reverts max_phantom_processes unless you ran device_config set_sync_disabled_for_tests persistent beforehand. That is why the fix can look like it worked and then stop working the same afternoon. A system update can reset any of them. Either way you have only widened the limit, not removed the mechanism, so a heavy enough workload can still be killed.

Does the signal 9 error kill AI coding agents like Claude Code on Termux?

Yes, and this is where it bites hardest. Claude Code can be installed on Termux via npm with workarounds — since v2.1.113 that takes a glibc workaround of its own — but an agent session is a long-running, CPU-active process, which is precisely what the phantom killer targets. Even with the fix applied, a long agent run on a backgrounded or battery-constrained phone is the most likely thing to be terminated.

Does this error happen in a cloud Linux container?

No. The phantom process killer is an Android OS feature. A Cosyra workspace is a per-user Ubuntu 24.04 container on Azure AKS, not Android, so the mechanism that produces signal 9 does not exist there. A long-running agent keeps going while your phone is locked, and the container hibernates and resumes rather than getting killed mid-task.

tl;dr

[Process completed (signal 9)] is the Android 12+ phantom process killer, not a Termux bug. Fix it by your version: Android 14+ has a Developer Options toggle ("Disable child process restrictions"); Android 12, 12L, and 13 need adb shell settings put global settings_enable_monitor_phantom_procs false; rooted phones run the same with su. Reboot after. The catch: it widens the limit, an OS update can reset it, and long AI agent sessions are still the most likely thing to be killed. A cloud Ubuntu container is not Android, so the error category does not exist there.

Google Play / App Store. Sign up for 1 hour free, no credit card. Extend with a 10-hour, 7-day trial when you want more.

Run long agent sessions where signal 9 can't reach them. A Cosyra container is real Ubuntu on Azure, with Claude Code, Codex CLI, OpenCode, and Gemini CLI pre-installed.

See pricing