Code Monkey home page Code Monkey logo

Comments (30)

pgaskin avatar pgaskin commented on May 16, 2024 6

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.

fornwall avatar fornwall commented on May 16, 2024

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.

yajo avatar yajo commented on May 16, 2024

but then how do file managers write there?

from termux-app.

cswl avatar cswl commented on May 16, 2024

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.

yajo avatar yajo commented on May 16, 2024

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.

Craeckie avatar Craeckie commented on May 16, 2024

+1 feature would be very useful!

from termux-app.

fornwall avatar fornwall commented on May 16, 2024

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.

yajo avatar yajo commented on May 16, 2024

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.

terba avatar terba commented on May 16, 2024

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.

Neo-Oli avatar Neo-Oli commented on May 16, 2024

@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.

terba avatar terba commented on May 16, 2024

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.

Neo-Oli avatar Neo-Oli commented on May 16, 2024

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.

terba avatar terba commented on May 16, 2024

Media library scanning doesn't recognizes termux's external folder, but a simple folder based player works. Thanks!

from termux-app.

wshanks avatar wshanks commented on May 16, 2024

@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.

terba avatar terba commented on May 16, 2024

@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.

lbmn avatar lbmn commented on May 16, 2024

+1

from termux-app.

CaptainPackers avatar CaptainPackers commented on May 16, 2024

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.

Cypher1 avatar Cypher1 commented on May 16, 2024

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.

HJarausch avatar HJarausch commented on May 16, 2024

For me, it doesn't work after I leave root with 'exit'.

from termux-app.

insign avatar insign commented on May 16, 2024

@geek1011 worked like a charm!

from termux-app.

pgaskin avatar pgaskin commented on May 16, 2024

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.

rogerxxxx avatar rogerxxxx commented on May 16, 2024

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.

Quasic avatar Quasic commented on May 16, 2024

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.

pgaskin avatar pgaskin commented on May 16, 2024

@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.

Quasic avatar Quasic commented on May 16, 2024

@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.

komi015 avatar komi015 commented on May 16, 2024

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.

giggls avatar giggls commented on May 16, 2024

For me, it doesn't work after I leave root with 'exit'.

Same here (Android 8.1 /LineageOS 15.1).

from termux-app.

Chubukov-Aleksey avatar Chubukov-Aleksey commented on May 16, 2024

I found that AnExplorer can request permission to write on sdcard without need to select sdcard's root folder.

from termux-app.

QJKX avatar QJKX commented on May 16, 2024

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.

bhagwandassony1 avatar bhagwandassony1 commented on May 16, 2024

Screenshot_20200804-142357

from termux-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.