Sample Header Ad - 728x90

Start bash script on boot not rooted Android 7.0 and Android 9.0 device

0 votes
1 answer
2256 views
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" &
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.
Asked by user1325696 (101 rep)
Feb 7, 2020, 04:34 AM
Last activity: Jan 19, 2021, 09:44 AM