3

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 :

  1. Use SManager Version : 3.0.9

enter image description here

Conclusion of this method : Killed

  1. 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.

Phantômaxx
38.1k21 gold badges88 silver badges122 bronze badges
asked Sep 19, 2019 at 10:24
5
  • See if your root method provides su.d like support. Commented Sep 19, 2019 at 10:39
  • what can i do to checking if root provides it ? Commented Sep 20, 2019 at 3:56
  • Look for /su.d folder Commented Sep 20, 2019 at 8:24
  • what if there is not /su.d folder ? i did not found /su.d on my phone Commented Sep 20, 2019 at 11:24
  • then i can only suggest to update to magisk as it provides su.d support and much more Commented Sep 20, 2019 at 11:57

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.