Run Termux Command with Termux:Tasker

by AFPing

Version 1 (March 26, 2021)

Download (1,627 downloads)

I think this is the best way to run Termux commands with Automate.

- you can send parameters and receive the stdout, stderr and exitcode of the scripts.
- You can install and use any package from termux, like NodeJS or Python.

- You have to install the Termux:Tasker plugin.


1) Go to Playstore and install Termux.

2a) Go to FDroid and install the Termux:Tasker plugin.

2b) You can also install Termux:Tasker from the playstore but it costs like 2 dollars.

3) Open Termux and run: mkdir -p ~/.termux/tasker

4) Create a shell script with: nano ~/.termux/tasker/

The following two lines are the content of the script from this example:

##### begin
echo $1
##### end

5) Give execution permission to the script with running: chmod u+x ~/.termux/

6) Check out the content of this flow

IMPORTANT: The reason behind the expression that validates if ex != null is that sometimes Automate doesn't execute the script. It is weird but it happens sometimes. So this ensures that the script is actually executed.

4.4 average rating from 10 reviews

5 stars
4 stars
3 stars
2 stars
1 star

Rate and review within the app in the Community section.