Comments (30)
Finally figured it out for rooted devices running marshmallow or greater!
su
pm grant com.termux android.permission.READ_EXTERNAL_STORAGE
pm grant com.termux android.permission.WRITE_EXTERNAL_STORAGE
Edit: This only seems to work temporarily.
from termux-app.
Unless you have root you can't write to all locations on external SD cards. You should however be able to write to the folder Android/data/com.termux/ on it (which is the Android 5 permission model as you say)!
from termux-app.
but then how do file managers write there?
from termux-app.
File managers hack on the Storage Access Framework. Thats why they ask you first to choose the root folder of your external sdcard.
from termux-app.
I found that one of the Android developer spoke about the possibility for apps to write to SD card folders. It's a feature introduced in Android 5 after the issues about that raised from the community. I use OfficeSuite, which uses this method, and after selecting the folder for the first time you get full write access.
IMHO this is a very important feature for Termux because having a powerful terminal is only half-powerful unless you have a good editor for it, and any other app will have the same problem, but I'm opening an issue in TurboEditor too.
Could you please reopen this?
from termux-app.
+1 feature would be very useful!
from termux-app.
See Internal and external storage - it's possible to at least create a folder on the external SD card now ($HOME/storage/external
) where Termux can write.
from termux-app.
I have no Android 6 so I cannot try, but is it possible to share that folder with another apps, like a text editor?
from termux-app.
Currently I'm moving my music collection using termux's sshd to the internal storage and then I'm moving that to the external SD card with Amaze file manager on the decice. I have to do that in 5 parts on my super shiny new Android phone. And I even can not use rsync to update the collection later. And no mass storage mode on this fantastic phone. MTP simply can not handle that amount of data. And we are in 2016.
It's a shame that I was not able to repair my last Nokia N900... By the way thanks for Termux, without it I would only have landline phone in the future.
from termux-app.
@terba all my Music lives in ~/storage/external/ (termux-setup-storage
) which is a directory on the sdcard in /storage/[sdcard_name]/Android/data/com.termux/files. Music players do have access to this directory, so I just use it like that. But if you want you can move it with Amaze to the external sd-card root. This way you can do it in one part, because it writes directly to the sd.
from termux-app.
I had this idea also, to use termux's external folder for music library, and even tried it, but Vanilla Music was not able to see the files. Maybe I missed something? I try it again. Thanks!
from termux-app.
I am using Poweramp, which seems to work. But I have seen other apps completely ignore the Android folder, even if explicitly set. I still haven't found a Gallery app that let's me choose the termux folder.
from termux-app.
Media library scanning doesn't recognizes termux's external folder, but a simple folder based player works. Thanks!
from termux-app.
@terba I had the same problem with the default Android music player not showing files that I had transferred to the SD card with rsync. I found that using another app to force rescan the SD card allowed the music files to show up in the music player.
from termux-app.
@Neo-Oli and @willsALMANJ: On my device a .nomedia file gets created at boot time in the external SD cards "Android" folder. That is what prevents media indexing my ...com.termux/files/home/storage/external folder. If I remove that .nomedia file with a file manager and trigger a reindex after each boot, my files show up until the next reboot. But it is useless for me anyway, because Android media indexer can not deal with UTF8 in tags... And this OS is used by the whole world... The solution is to forget the Android's built-in media library, and use a music player with it's own media library as Neo-Oli suggested above.
from termux-app.
+1
from termux-app.
On my Asus ZenPad 10.1 (P023) running Android 5.0.2, I do not see a com.termux folder at /storage/MicroSD/Android/data, so I don't even have the option of writing there. Anyone have any experience with this. I would like to use termux to write to my sd card.
Thanks
I think I found the answer here. Seems like I needed to run termux-setup-storage for the com.termux folder to be created on Android/data
from termux-app.
Can this be reopened. I would like to be able to use my terminal to edit and run files that I already have, I guess I could move everything into termux's data folder but that seems messy and unnecessary.
from termux-app.
For me, it doesn't work after I leave root with 'exit'.
from termux-app.
@geek1011 worked like a charm!
from termux-app.
And without root, you can just run that in adb shell from a computer without the su command, and that should be permanent.
from termux-app.
I tried the prior mentioned "pm" read/write permission within an adb shell, and I still do not have write access on the external storage device. I do not have a rooted device, but geek1011 stated should work. However, most other adb functions work.
I have a Samsung Galaxy S3 Tab. Maybe the adb shell is limited to certain Android versions or devices? Most adb functions do appear to work, but this Samsung device's adb functions seems to have restricted push/pull operations. I believe I was logging adb in through the device's wifi/wireless instead of wired USB. And still not working after ensuring I was logging adb through USB wired method.
I would really like to see the termux writable folder "$HOME/storage/external-1 -> /storage/3065-3134/Android/data/com.termux/files" to at least show a symlinked folder within the main external storage root folder, else I'm really apt to just accidentally format or delete folders without taking caution of backing-up this hidden folder!
from termux-app.
I wish the SD card supported symlinks, too, or that Android wasn't blocking access to all but that one deep folder, but so far, I haven't seen a better solution. I have seen some problems solved that I thought were harder, though...
from termux-app.
@Quasic I'm not sure if this will work, but have you tried making a disk image file on the SD card, and loop mounting it?
from termux-app.
@geek1011, I have not, but others have (@SDRausty is one, I think.) As I understand it, it is near impossible without root.
from termux-app.
For this problème u Can use this comand:
termux-setup-storage ,it fond and u agree the the following android dialogue to allow sdcard permissions.
Thank
from termux-app.
For me, it doesn't work after I leave root with 'exit'.
Same here (Android 8.1 /LineageOS 15.1).
from termux-app.
I found that AnExplorer can request permission to write on sdcard without need to select sdcard's root folder.
from termux-app.
Finally figured it out for rooted devices running marshmallow or greater!
su pm grant com.termux android.permission.READ_EXTERNAL_STORAGE pm grant com.termux android.permission.WRITE_EXTERNAL_STORAGE
Edit: This only seems to work temporarily.
This doesn't seem to work (anymore?) on 8.1.
The commands work without an error, but I can't actually write to the external SD card.
WRITE_MEDIA_STORAGE looks like the correct permission (but putting that in the command doesn't work because it's not in the com.termux manifest.) I expect the permission to be restricted to system apps anyway, but that might be a better option for rooted users than running as root?
from termux-app.
from termux-app.
Related Issues (20)
- D HOT 1
- CTRL + space bar should become CTRL-@ HOT 4
- Android 14 Ghost keyboard HOT 2
- [Feature]: overlay for preventing termux-app from going to background HOT 7
- [NOTICE] 2024-04-01 Termux Apps Vulnerability Disclosure HOT 8
- [Bug]: Password Autofill Provider shows on termux HOT 4
- [Bug]:sudo error HOT 2
- [Bug]:in nodejs cant install sqlite3, node-gyp HOT 1
- Incorrect permissions after upgrading to PHP 8.3 HOT 1
- [Feature]: Switch session by keyboard HOT 6
- [Bug]: Termux SAF cannot delete non-empty directory HOT 1
- Termux intent HOT 3
- [Feature]: fping 5.1 HOT 1
- Allow access HOT 14
- [Bug]: nodejs Dependencies HOT 7
- [Bug]: Can't run Nodejs, libicu version incompatible HOT 3
- [Bug]: error on package PHP HOT 1
- [Feature]: Change the mouse wheel scroll rate.
- [Bug]: npm install HOT 1
- [Feature]: Ability to use emacs shortcuts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termux-app.