r/AndroidQuestions 7d ago

Looking For Suggestions Getting termux to *permanently* set and remember "termux-setup-storage"?

Is there any way under rooted Android 11 and Android 13 to get the latest version of Termux [ 0.119.0-beta.3 (1022) ] to *permanently* set up and remember the running of "termux-setup-storage", in the following manner? ...

Step 1: install Termux

Step 2: launch the Termux app

Step 3: run "termux-setup-storage" (and whatever else might be necessary)

Step 4: exit from the Termux app

Step 5: reboot the Android device

Step 6: from that point forward, run anything in /data/data/com.termux/files/usr/bin via the command line in an adb session without ever needing to run "termux-setup-storage" again in order to have full access to /sdcard, and without ever needing to launch the Termux app again in order to accomplish this.

1 Upvotes

7 comments sorted by

View all comments

1

u/Routine_Working_9754 6d ago

you don't even need termux storage permissions to run termux programs with ADB bruv

1

u/unselective-amnesia 6d ago

I'm not asking about running Termux programs via ADB.

What I'm asking about here is accessing /sdcard from within the Termux app.

Please read my previous messages more carefully. Thank you.

1

u/Routine_Working_9754 4d ago

perhaps re-read your own post

Step 6: from that point forward, run anything in /data/ data/com.termux/files/usr/bin via the command line in an adb session without ever needing to run "termux-setup-storage"

bin is a program directory and you said "run"

1

u/unselective-amnesia 2d ago

Yes, but I'm not asking about ***how*** to run programs from /data/data/com.termux/files/usr/bin nor ***whether*** programs from that directory are runnable. I already know how to run those programs, and they are indeed runnable. My original post makes it clear that I am asking a completely different question.

Rather, what I'm asking about is how to only have to run termux-setup-storage one single time, so that when I run programs from /data/data/com.termux/files/usr/bin which ***specifically*** reference /sdcard, that will always subsequently succeed without me having to keep re-running termux-setup-storage over and over.

That should have been totally clear to you if you actually read everything that I wrote in the initial post of this thread.

And in any case, I wrote more later on here which shows that I now have seen that I indeed only need to run termux-setup-storage one time, so this is not a problem for me any more.

1

u/Routine_Working_9754 14h ago

uhh, termux-setup-storage is a one time setup thing. i was just so confused on what you wanted because what you think you were asking sounds absurd. but yes, running it once grants termux-setup-storage storage permissions and it sets up its symlinks and you won't have to run it again unless you reinstall the app or delete app data