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.
-
See if your root method provides su.d like support.asim– asim2019年09月19日 10:39:03 +00:00Commented Sep 19, 2019 at 10:39
-
what can i do to checking if root provides it ?Haryono Sariputra– Haryono Sariputra2019年09月20日 03:56:51 +00:00Commented Sep 20, 2019 at 3:56
-
Look for /su.d folderasim– asim2019年09月20日 08:24:11 +00:00Commented Sep 20, 2019 at 8:24
-
what if there is not /su.d folder ? i did not found /su.d on my phoneHaryono Sariputra– Haryono Sariputra2019年09月20日 11:24:43 +00:00Commented Sep 20, 2019 at 11:24
-
then i can only suggest to update to magisk as it provides su.d support and much moreasim– asim2019年09月20日 11:57:57 +00:00Commented Sep 20, 2019 at 11:57