2

Android 8.1 PIXEL 2 with root access.

I have seen this asked here once before but the only solution didn't help me at all. I am going to try and make this as simple as I can for the example.

If I run the following command in terminal emulator or adb shell:

am force-stop com.myapp.frustrated

It will quit the app just fine. But when I run it in this shell script:

#!/bin/sh
am force-stop com.myapp.frustrated

Nothing happens. It is odd to me that I can do many other commands just fine in a script, but a handful of them do not work.

Any suggestions you have are much appreciated.

Jason Waltz
  • 175
  • 3

1 Answers1

-1

Removing #!/bin/sh fixed my issue. Thanks

Jason Waltz
  • 175
  • 3
  • 3
    Replacing it by /system/bin/sh would most likely have worked as well. Background: That line specifies the binary ("interpreter") to run this script with. As there is no /bin/sh on Android, the specified interpreter wasn't found and thus the script not run. Could you please verify that – and then integrate these facts with your answer? When done please ping me, so I can remove my comment again. – Izzy Feb 12 '20 at 08:03
  • 1
    As a side note: on recent Android versions /bin is a symlink to /system/bin. – Irfan Latif Feb 12 '20 at 19:52