[Bug]: The command "termux-setup-storage" is not working
Problem description
Everytime I try to use this command to get access to my files, nothing happens and the "$" disappear. Then I have to click "Ctrl + C" to make this "$" come back.
Steps to reproduce the behavior.
Just try to run the code "termux-setup-storage"
What is the expected behavior?
The "$" disappear and then nothing happens
System information
- Termux application version: 0.118.1
- Android OS version: 11
- Device model: Samsung A10
I get this too except it's like this:
termux-setup-storage /data/data/com.termux/files/usr/bin/am: 30: exec: /system/bin/app_process: not found /system/bin/app_process bash: /system/bin/app_process: cannot execute: required file not found
I'm on aarch64 only if that matters . No 32bit (s25u)
~ $ stat /system/bin/app_process File: /system/bin/app_process -> app_process64 Size: 13 Blocks: 8 IO Block: 4096 symbolic link Device: 254,14 Inode: 258521470 Links: 1 Access: (0755/lrwxr-xr-x) Uid: ( 0/ root) Gid: ( 2000/ shell) Context: u:object_r:system_file:s0 Access: 2021-12-31 16:00:00.000000000 -0800 Modify: 2021-12-31 16:00:00.000000000 -0800 Change: 2021-12-31 16:00:00.000000000 -0800
@ascendbeing your issue is related to https://github.com/termux/termux-exec-package/issues/31
@ascendbeing Can you post output of termux-info?
@agnostic-apollo any ideia how to solve my problem?🤔🤔 It's not working yet🥲
Run apt update && apt upgrade and restart termux, then try again, if that doesn't work, let me know.
@agnostic-apollo I tried it again but it's still not working
Run command then ctrl+c once it hangs, then generate logcat dump and email me or post here.
https://github.com/termux/termux-packages/blob/site/site/pages/en/projects/docs/repos/main/packages/termux-tools/logcat/index.md#to-get-full-system-logs-of-other-apps-and-the-android-system
Upload the full file as attachment instead, too long for clipboard.
Idk if it's related, but I had permission issues accessing my symlinks in storage after the last update, even though the app had all the necessary permissions from the beginning. However, resetting the storage permissions of the app as described here solved the problem for me
Idk if it's related, but I had permission issues accessing my symlinks in storage after the last update, even though the app had all the necessary permissions from the beginning. However, resetting the storage permissions of the app as described here solved the problem for me
Same problem, and same solution
If on Android 11, then manually disable and grant storage permission from Termux app info in android settings.
Idk if it's related, but I had permission issues accessing my symlinks in storage after the last update, even though the app had all the necessary permissions from the beginning. However, resetting the storage permissions of the app as described here solved the problem for me
In my case termux-setup-storage didn't solve the problem. I keep getting "Permission denied" . Android 15 and Termux 0.118.2 . Any ideas?
If it hangs, then do https://github.com/termux/termux-app/issues/4440#issuecomment-2763395482
If does not hang and succeeds but still no permission, then grant All Files Access from Android settings -> Apps -> Additional -> Special app access.
If does not hang and succeeds but still no permission, then grant All Files Access from Android settings -> Apps -> Additional -> Special app access.
The Special Access lists Termux:API and enabling the all files access for that entry fixes the issue.
from Android settings ->
If does not hang and succeeds but still no permission, then grant All Files Access from Android settings -> Apps -> Additional -> Special app access.
The Speciall Access lists Termux:API and enabling the all files access fixes the issue.
It does fix the issue with permission. Thanks.
From v0.118.2 onwards "Special access" is required to access files under ~/storage for some reason.
If you're on Samsung: Settings > Apps > Click 3 dots on top right corner > Special access > All files access > Enable Termux
From v0.118.2 onwards "Special access" is required to access files under
~/storagefor some reason.If you're on Samsung: Settings > Apps > Click 3 dots on top right corner > Special access > All files access > Enable Termux
I upgraded Termux from v0.118.1 and termux does not display in All files access. How to fix it?
If you're on Samsung: Settings > Apps > Click 3 dots on top right corner > Special access > All files access > Enable Termux
I have v0.118.2 but Termux is not listed in Special access > All files access
Solved by revoking permission and granting it again
v0.118.2 does not request All files access permission, and only Termux app info -> Permissions -> Files permission. If you are seeing All Files Access permission, then it is coming from Termux:API 0.51.0 being installed, which is likely the cause of the issue, but I can't reproduce it myself.
Something weird happened indeed, had "all files" permission setup for a long time (all working fine), just noticed termux can't reach anymore anything in the subdirectories in ~/storage. termux-setup-storage works but isn't prompting for more permissions, and I can't grant "all files" anymore to termux but somehow I can give it to Temux:API and weirdly enough this fixes it.
Apart from that probably the changes come from something similar to what happened to Nextcloud at the beginning of 2025 (note that issue spans almost 5 years by now, Google is always changing something) https://github.com/nextcloud/android/issues/6248
I had to downgrade most previous version are working fine until version 0.118.2 . You can downgrade to a different release temporarily
@FrankMutuma try 0.118.3. Make sure you enable the "All Files Access" for Termux (and Termux API for good measure). Maybe even flip it back and forth, even if enabled already. Weirdly enough on the latest Pixel the permission returned now for Termux but popped up enabled (though earlier it started working anyway by enabling it for Termux API). On an older Android 12 I still had the permission for (simple) Termux, but it got disabled, enabled it and it worked fine. However, it got disabled with the last update, enabled it and works fine. There's some reason for sure, but a bit weird when I enabled it for Termux it flipped it for Termux API too, even if they're different apps and versions.
Meanwhile NextCloud's issue with being denied this permission for the Play Store version made the tech news. Last year this killed Syncthing, they couldn't push any update with no explanation from the beginning of the year and at some point they just decided to kill the Android app completely (there's a syncthing-fork, but it's a third party, very nice, useful, open source and all but not from the Syncthing Foundation).