androidtermux

termux Why can't I run the program on SDcard?


u0_a238@localhost  ~/storage/external-1 # cat test.c
#include <stdio.h>

int main()
{
        printf("Hi!");
        return 0;
}
 u0_a238@localhost  ~/storage/external-1 # gcc test.c -o test
u0_a238@localhost  ~/storage/external-1 # ./test
zsh: permission denied: ./test
 ✘ u0_a238@localhost  ~/storage/external-1 # bash ./test
./test: ./test: cannot execute binary file
 ✘ u0_a238@localhost  ~/storage/external-1 # sh ./test
./test: 1: Syntax error: word unexpected (expecting ")")
u0_a238@localhost  ~/storage/external-1 # mv test ~
 u0_a238@localhost  ~/storage/external-1 # ~/test
Hi!%                                               u0_a238@localhost  ~/storage/external-1 # 

termux Why can't I run the program on SDcard? Is this Android's responsibility? Is there any way to get termux to execute the SDcard program? I want to build some programs from the source code and install them on SDcard Or install the APK directly on the SDcard Is there any other way besides root?


Solution

  • See the Termux documentation.

    Unfortunately, SD cards are considered external storage and do not support executables.

    You need to copy your project or executable to a $HOME subfolder.