forked from termux/termux-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAndroid Termux stuff
More file actions
87 lines (76 loc) · 4.4 KB
/
Copy pathAndroid Termux stuff
File metadata and controls
87 lines (76 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Focus stacking:
pkg install git
pkg install make
pkg install clang
apt install x11-repo && apt update && apt install opencv
pkg install pkg-config
git clone https://github.com/PetteriAimonen/focus-stack.git
cd focus-stack/
make
cd build
./focus-stack ~/focus-stack
pkg install python (needed because for some reason OpenCV is linked with a python lib).
Ultralytics
pkg update
pkg install make
pkg install clang
pkg install patchelf
pkg install ninja
pkg install cmake
pkg install pkg-config
pkg install python
apt install x11-repo && apt update && apt install opencv-python
pkg install python-torch
pkg i tur-repo
pkg i python-pandas
pip install ultralytics (it will fail at OpenCV)
pip install seaborn
pip install requests
pip install py-cpuinfo
pip install pyyaml
pkg install python-torchvision
pip install tqdm
pip install ultralytics-thop
pip install psutil
pkg install python-scipy
pip install ultralytics --no-deps
Once all is done, just type: "yolo" and see if it works.
Disabling various Android things that kill your processes
(usb debug)
adb shell "/system/bin/device_config set_sync_disabled_for_tests persistent; /system/bin/device_config put activity_manager max_phantom_processes 2147483647; settings put global settings_enable_monitor_phantom_procs false"
adb shell "/system/bin/device_config put activity_manager power_check_max_cpu_1 256; /system/bin/device_config put activity_manager power_check_max_cpu_2 256; /system/bin/device_config put activity_manager power_check_max_cpu_3 256; /system/bin/device_config put activity_manager power_check_max_cpu_4 256;"
adb shell "settings put global activity_manager_constants power_check_max_cpu_1=256; settings put global activity_manager_constants power_check_max_cpu_2=256; settings put global activity_manager_constants power_check_max_cpu_3=256; settings put global activity_manager_constants power_check_max_cpu_4=256;"
(root)
sudo device_config set_sync_disabled_for_tests persistent
sudo device_config put activity_manager max_phantom_processes 2147483647
sudo settings put global settings_enable_monitor_phantom_procs false
(this prevents Android from killing your long running processes after a while. There is a "new" way and an "old" way to set those settings, but at least on some OSes, such as LineageOS22 the old way is used. So I am including both)
sudo settings put global activity_manager_constants power_check_max_cpu_1=256
sudo settings put global activity_manager_constants power_check_max_cpu_2=256
sudo settings put global activity_manager_constants power_check_max_cpu_3=256
sudo settings put global activity_manager_constants power_check_max_cpu_4=256
sudo device_config put activity_manager power_check_max_cpu_1 256
sudo device_config put activity_manager power_check_max_cpu_2 256
sudo device_config put activity_manager power_check_max_cpu_3 256
sudo device_config put activity_manager power_check_max_cpu_4 256
Allowing your app to recive alarms more often when not idle (every minute)
(root)
sudo settings put global alarm_manager_constants min_interval 60000
sudo device_config put alarm_manager min_interval 60000
(adb shell)
adb shell "settings put global alarm_manager_constants min_interval=60000"
adb shell "/system/bin/device_config put alarm_manager_constants min_interval 60000"
Allow background apps to run longer from broadcast receivers (such as all termux api stuff). It will show the App not responding menu, rather than kill it. Not ideal, but there is no other way of disabling this restriction without recompiling some Android source code:
(root)
sudo settings put secure anr_show_background 1
(adb)
adb shell "settings put secure anr_show_background 1"
Make the app receive more alarms than allowed while idle (once evey 9 minutes or so), and allowing it to do more work while it's idle. For some reason it doesn't work on LineageOS 22.
(root)
sudo settings put global alarm_manager_constants allow_while_idle_long_time=20000,allow_while_idle_whitelist_duration=300000
sudo device_config put alarm_manager_constants allow_while_idle_long_time 20000
sudo device_config put alarm_manager_constants allow_while_idle_whitelist_duration 300000
(adb)
adb shell "settings put global alarm_manager_constants allow_while_idle_long_time=20000,allow_while_idle_whitelist_duration=300000"
adb shell "/system/bin/device_config put alarm_manager_constants allow_while_idle_long_time 20000"
adb shell "/system/bin/device_config put alarm_manager_constants allow_while_idle_whitelist_duration 300000"