MacroDroid shell script non-root location permission denied I am currently trying to run a simple shell script via MacroDroid. devices are Huawei and Samsung (Oreo not rooted).
in MacroDroid tried following locations:
/data/local/tmp/script.sh
/storage/emulated/0/MacroDroid/script.sh
/storage/emulated/0/Android/data/com.arlosoft.macrodroid/files/script.sh

MacroDroid reports permission denied:
/system/bin/sh: &lt;stdin&gt;[4]: /data/local/tmp/script.sh: can't execute: Permission denied
/system/bin/sh: &lt;stdin&gt;[4]: /storage/emulated/0/MacroDroid/script.sh: can't execute: Permission denied
/system/bin/sh: &lt;stdin&gt;[4]: /storage/emulated/0/Android/data/com.arlosoft.macrodroid/files/script.sh: can't execute: Permission denied

the script itself is working when running from adb shell:
adb shell
$ cd /data/local/tmp
$ chmod 0755 script.sh
$ ls -nZ script.sh
-rwxr-xr-x 1 2000 2000 u:object_r:shell_data_file:s0 ...
$ ./script.sh

In Terminal Emulator the script is readable (and passing as argument to sh works):
$ /data/local/tmp/script.sh
/system/bin/sh: /data/local/tmp/script.sh: not found
$ sh /data/local/tmp/script.sh
$ sh /storage/emulated/0/MacroDroid/script.sh
$ sh /storage/emulated/0/Android/data/com.arlosoft.macrodroid/files/script.sh

MacroDroid got all permissions granted in settings. Macros can create own log files in /storage/emulated/0
What is the proper location for shell scripts on non-rooted device?
Shell script Action is somewhat misleading in itself. It should be renamed as &quot;Shell commands&quot; instead. In the input area you are required to input the whole of your script actually. If you don't want that but wants to run an already made script instead, run it as
sh SCRIPT_PATH
sh /sdcard/my_script.sh     # example

This should work.