termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.34k stars 3.72k forks source link

Can't access external storage #1683

Closed superbonaci closed 4 years ago

superbonaci commented 4 years ago

I run termux-setup-storage and waits a couple of seconds and nothing happens. I want to gain access to external microsd which I replaced yesterday. Storage permission is allowed.

ghost commented 4 years ago

I want to gain access to external microsd which I replaced yesterday.

Write access isn't possible. https://wiki.termux.com/wiki/Internal_and_external_storage

Look into $HOME/storage for symlinks to Termux private directory on your microsd (should be named external-1).

superbonaci commented 4 years ago

I don't understand why other apps can gain access to external sdcard and Termux can't. Technically is possible, why not implement it?

ghost commented 4 years ago

Because Termux environment technically is not other apps. Yes, terminal emulator is Android app but command line utilities are Linux apps. CLIs do not have access to Android API, they are executed directly by kernel bypassing the Android framework.

ghost commented 4 years ago

Technically is possible, why not implement it?

Possible, bot wontfix. Why?

superbonaci commented 4 years ago

Ok I understand. I was trying to run some Go programs on external sd, but I see will not be possible in the near future.

ghost commented 4 years ago

Even if external sd would be writable, you won't be able to execute any programs (except scripts) from it anyway. All kinds of storage (except /system and /data) are mounted with noexec, effectively disabling program execution on them.

superbonaci commented 4 years ago

Ok I understand. What happens if I have LineageOS rooted with Magisk? Could I use Termux more broadly?

ghost commented 4 years ago

With root you will have at least read-write access on external sdcard. You can try to remount it with "exec" option to enable execution, not sure whether sdcardfs daemon will handle it properly.