Android 5

Termux 0.54

Not rooted, no wish to

$ pwd
$ id
uid=10096(u0_a96) gid=10096(u0_a96) groups=1015(sdcard_rw),1028(sdcard_r),3003(inet),9997(everybody),50096(all_a96)
$ ls -l python
total 0
$ ls -dl python
drwxrwx---    2 root     sdcard_r     32768 Sep 23 22:10 python

So according to permissions, I should be able to write to the python folder. But creating a file gives permission denied.

I have seen the platform.xml solution but can't edit the file.

I would like to write to card then easy to move card and files between machines.

Regards John

  • Maybe it has something to do with SELinux. What does ls -ld /storage/sdcard1/ show though? Also have you enabled the storage permission in the app settings of Termux?
    – Tom Yan
    Sep 24, 2017 at 14:12
  • This is something Google is to blame. From Android 5 onwards, there have been even more restrictions placed on the external SD. Apps are now expected to make use of a so-called DocumentProvider interface, as to ask the user for the permission to operate on the SD card. As you may infer by the above, there is no way to manually grant this permission if it is not requested, but to have root privileges and install Xposed, or to have a custom recovery, init.d support and flash a .zip to allow SD card access to any app.
    – Grimoire
    Sep 24, 2017 at 19:21
  • @TomYan Sadly, as you can see from my answer here, the Storage permission only affects /storage/emulated/0 (/storage/sdcard0 on Lollipop).
    – Grimoire
    Sep 24, 2017 at 19:32

1 Answer 1


Use termux-setup-storage to setup your storage. See https://wiki.termux.com/wiki/Termux-setup-storage for instructions and more information. Write data will be enabled in the Termux private folder on external storage through ~/storage/external which is a link to Android/data/com.termux/files/ on your external SD card.

  • 1
    This is for android 6. As I mentioned, I have android 5.
    – JohnN
    Dec 11, 2017 at 12:42
  • Android 5 support was dropped in January 2020
    – S D Rausty
    Jul 20, 2020 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .