Termux:Boot Automation app for Android description
This plugin for Android Freeware allows programs to be run at boot.
Instructions:
- Start the Termux:Boot app once by clicking on its launcher icon.
- This allows the app to be run at boot.
- Create the ~/.termux/boot/ directory.
- Put scripts you want to execute inside the ~/.termux/boot/ directory.
- If there are multiple files, they will be executed in a sorted order.
Note that you may want to run termux-wake-lock as the first thing to ensure that the device is prevented from sleeping.
Example:
To start an sshd server and prevent the device from sleeping at boot, create the file ~/.termux/boot/start-sshd containing the line:
termux-wake-lock && sshd