Android 12+ 使用指南
当前版本的两仪不需要 ADB,也不需要执行下面的命令。本页只适用于旧版本。
Android 12 起,系统的 phantom process 机制会限制一个 App 的子进程数量,超出就杀掉,两仪会因此无法开机或突然退出。用 ADB(或 ROOT 权限)执行下面的命令可以解除限制。
Android 13 及以上(推荐)
adb shell settings put global settings_enable_monitor_phantom_procs false
恢复:
adb shell settings put global settings_enable_monitor_phantom_procs true
Android 12 / 12L
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent; /system/bin/device_config put activity_manager max_phantom_processes 2147483647"
恢复:
adb shell "/system/bin/device_config set_sync_disabled_for_tests none; /system/bin/device_config put activity_manager max_phantom_processes 32"
Android 13 及以上两组命令都有效,推荐第一组。
说明
- 有 ROOT 权限时,去掉
adb shell,直接用 ROOT 权限执行引号里的命令,不需要电脑。 - 没有电脑时,也可以用手机上支持无线调试的 ADB 工具执行;执行完即可卸载。
- 视频演示:在 B 站观看。
Android 12+ guide
The current version of Twoyi needs no ADB and none of the commands below. This page is for older versions only.
Since Android 12, the system's phantom process mechanism limits how many child processes an app may have and kills the rest, so Twoyi fails to boot or quits suddenly. Run the commands below with ADB (or as root) to lift the limit.
Android 13 and later (recommended)
adb shell settings put global settings_enable_monitor_phantom_procs false
To restore:
adb shell settings put global settings_enable_monitor_phantom_procs true
Android 12 / 12L
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent; /system/bin/device_config put activity_manager max_phantom_processes 2147483647"
To restore:
adb shell "/system/bin/device_config set_sync_disabled_for_tests none; /system/bin/device_config put activity_manager max_phantom_processes 32"
On Android 13 and later both sets work; the first is recommended.
Notes
- With root, drop
adb shelland run the quoted command as root; no computer is needed. - Without a computer, an on-device ADB tool that uses wireless debugging can run the command; uninstall it afterwards.
- Video walkthrough (Chinese): on Bilibili.