Following this tutorial I have compiled a Hello World! ARM binary from C source using gcc
.
I want to run this program on my unrooted Android phone but I can't figure out an easy way to do it.
What I've tried:
Copying
hello
to/sdcard
and trying to run it from there. This doesn't work because the internal storage is mounted with thenoexec
flag.Copying
hello
to/data/local/
usingcp hello /data/local/
orcat hello > /data/local/hello
as explained here. This also doesn't work and I get a "permission denied" error.Installing a terminal emulator program such as Termux and using the Termux app to copy
hello
from/sdcard/hello
to/data/data/com.termux/files/home
, runningchmod +x hello
and then running./hello
from the Termux home directory within the Termux app. This works but is not a feasible solution.
Is there a better/easier way to run native ELF executables on an unrooted Android phone directly through ADB and doesn't involve installing any apps?