I need to set up an app-killing service for unrooted Android 9+ devices using Automate. The service has to launch automatically at device start and keep sending kill commands to selected system (!) services at regular intervals unless said services are in focus/in the foreground.
Unfortunately, setting up and running Automate seems unnecessarily cumbersome. I have used adb
extensively, so no problem there. However, step 5 in the setup manual says
- On the PC, execute the shell command
adb tcpip 5555
. This step has to be repeated after every device reboot.
Having to hook up a mobile device to a PC after each and every reboot (e.g. due to empty battery) is completely impractical and contradicts the use of Android itself. Is there a way to set up Automate either 100% locally from within Android, or at least only once from a PC at the very beginning and then have the app run automatically even after a device reboot?
I have already set up a simple Automate flow as a minimal example and granted all necessary privileges, such as access to the SD card, executing shell commands, and access to Samsung accessibility service. But when running the flow, I get the following errors in the log output:
Flow beginningDelayApp in foreground?App killFailed to start privileged servicejava.util.concurrent.CancellationException: Please execute: sh /sdcard/Android/data/com.llamalab.automate/cache/start.shjava.util.concurrent.TimeoutException: Service startup timeoutStopped by failure