First of all , my rooted phone is Xiao Mi Red Mi Note 7.
MIUI version : 10.2.3.
Android Version : 9 PKQ1.180904.001.
Shell script :
set -xeo pipefail
_stopnow() {
test -f stopnow && echo "Stopping!" && rm stopnow && exit 0 || return 0
}
while true
do
_stopnow
am instrument -w -r -e debug false -e class com.package.mobile.name com.package.mobile.test/android.support.test.runner.AndroidJUnitRunner
done
What i have tried :
- Use SManager Version : 3.0.9
Conclusion of this method : Killed
- Use service.rc in /system/etc/init
Because i did not have /init.d folder i am using /init instead.
I have file named /system/etc/init/mypackagepipefail.rc and /system/bin/runpipefail
mypackagepipefail.rc
on boot
start /system/bin/runpipefail
user system
group system readproc
runpipefail
#!/bin/sh
set -xeo pipefail
_stopnow() {
test -f stopnow && echo "Stopping!" && rm stopnow && exit 0 || return 0
}
while true
do
_stopnow
# Below here, you put in your command you want to run:
am instrument -w -r -e debug false -e class com.airasia.mobile.BigpayTest com.airasia.mobile.test/android.support.test.runner.AndroidJUnitRunner
Conclusion of this method : seems like service does not running on start / boot.
Is there something wrong in usage of the service.rc above ? Is there any other method to run shell script on boot ?
Any help would be so great. Thank you very much.