NOTICE:
Termux may be unstable on Android 12+. Android OS will kill any (phantom) processes greater than 32 (limit is for all apps combined) and also kill any processes using excessive CPU. You may get [Process completed (signal 9) - press Enter]
message in the terminal without actually exiting the shell process yourself. Check the related issue #2366, issue tracker, gist with details and this TLDR comment on how to disable trimming of phantom processes.
- On an ADB console, paste the following commands on the following 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"
adb shell settings put global settings_enable_monitor_phantom_procs false
- If it doesn't work on your phone,Reboot your phone.
adb reboot
pkg up -y;pkg i -y android-tools
-
After installing the package,you must open Developer Options in order to use wireless ADB with Termux.
-
Go to Settings, About Phone & Touch build-number for servial times.
-
On Xiaomi Phones, Touch MIUI version servial times.
-
After Opening Developer Options,Open wireless debugging & Split Screen.
-
Then,Open Termux & Pair Device with paring code.
-
You can also use two phones with a same wifi network.
-
Write This ADB Command in termux
adb pair 192.168.1.3:41538
adb connect 192.168.1.3:41115
- On Termux (or any Terminal Emulator), paste the following commands on the following order:
su -c /system/bin/device_config set_sync_disabled_for_tests persistent
su -c /system/bin/device_config put activity_manager max_phantom_processes 2147483647
su -c setprop persist.sys.fflag.override.settings_enable_monitor_phantom_procs false
- If it doesn't work on your phone,reboot your phone.
su -c reboot
-
On a Rooted phone with Magisk installed, flash the following module:
-
After that, `PhantomProcessKiller' might be deactivated on every device boot.
su -c /system/bin/dumpsys activity settings | grep max_phantom_processes
su -c /system/bin/device_config get activity_manager max_phantom_processes
- Both commands above should return
2147483647
su -c getprop persist.sys.fflag.override.settings_enable_monitor_phantom_procs
- It should return "false"
-
After restarting your phone,
-
It may be hot for a while.
-
Wait it to normal state.