Start bash script on boot not rooted Android 7.0 and Android 9.0 device I currently do it manually each time after my phone is restarted. I connect using adb and running this

adb shell sh /sdcard/AFolder/ascript.sh "a-dummy-argument" &amp;


Then I just disconnect the cable and script continue working.

How I can achieve the same thing on non rooted Android 7.0 and Android 9.0 devices(I have 2 and I would like to do this on both)? I would like to avoid rooting. From what I was reading it can not be done without rooting. My question is, would it be possible to install TWRP, backup stock ROM, modify stock ROM so that it would have an additional file ascript.sh (or run it from sd card) which will be started at startup. Then flash this modified ROM, to avoid doing this manually. Is this possible?

Note: adb via tcp I believe is not an option as to make adb work via tcp on non rooted device after each reboot we need to connect the device to PC first to switch to tcpip, so we back to the task how to avoid after reboot connecting phone to PC.
This app, called LADB — Local ADB Shell, can open an adb wifi shell without ever needing to connect to the PC:
https://play.google.com/store/apps/details?id=com.draco.ladb
Unfortunately you have to cut and paste your commands into it for now, I'm trying to get him to add editable shortcuts. It's a fairly new app.