I cannot figure out how to run a Termux command from Automation, and the configuration example [0] is a bit sparse. Can someone help? A detailed example would be most helpful, I think.
The first thing I am unsure about is if I should use the action type "Start another program" or "Run script or executable". With the first approach, it looks like the way to go would be to copy relevant bits of the Java code from the Termux wiki page on RUN_COMMAND [1] into Automation. With the second, to use an "am" command, again like in the wiki page.
I tried both, but couldn't get the action to do anything or the log to show anything helpful.
I have granted Automation the permission "Run commands in Termux environment".
[0]: https://server47.de/automation/examples.html
[1]: https://github.com/termux/termux-app/wi ... AND-Intent
How to run Termux commands?
Re: How to run Termux commands?
I'm not using Termux myself, so I can't test this without setting up an environment.
This might work:
- Start another program
- by action (not by activity)
- by start service
- Package: com.termux
- Class com.termux.app.RunCommandService
- Action name com.termux.RUN_COMMAND
- String parameter:
* name: com.termux.RUN_COMMAND_PATH
* value: /data/data/com.termux/files/home/test.sh
From the documentation it also uses arrays as parameters which Automation does not support yet. I don't know how relevant those are for Termux's operation.
This might work:
- Start another program
- by action (not by activity)
- by start service
- Package: com.termux
- Class com.termux.app.RunCommandService
- Action name com.termux.RUN_COMMAND
- String parameter:
* name: com.termux.RUN_COMMAND_PATH
* value: /data/data/com.termux/files/home/test.sh
From the documentation it also uses arrays as parameters which Automation does not support yet. I don't know how relevant those are for Termux's operation.