圖片來源: https://wiki.termux.com/wiki/Main_Page
存取 Android 上的資料夾
開啟 Termux 後執行:termux-setup-storage
執行命令後即會出現 storage/ 資料夾:
dcim -> /storage/emulated/0/DCIM downloads -> /storage/emulated/0/Download external-1 -> /storage/external_sd/Android/data/com.termux/files movies -> /storage/emulated/0/Movies music -> /storage/emulated/0/Music pictures -> /storage/emulated/0/Pictures shared -> /storage/emulated/0 |
(在插入 microSD 後才會出現指向外部記憶體的路徑, 若路徑仍不對或沒出現可自行用 ln -s 來建立)
cd storage/ 後螢幕跳出是否允許 Termux 存取的權限設定對話框, 按允許之後即可存取 Android 上的檔案:
cd storage/ $ ls dcim downloads movies music pictures shared $ ln -s /storage/emulated/0/WorkSpace WorkSpace $ ls -al total 8 drwx------ 2 u0_a101 u0_a101 4096 Jul 20 08:08 . drwx------ 4 u0_a101 u0_a101 4096 Jul 20 08:00 .. lrwxrwxrwx 1 u0_a101 u0_a101 29 Jul 20 08:08 WorkSpace -> /storage/emulated/0/WorkSpace lrwxrwxrwx 1 u0_a101 u0_a101 24 Jul 19 16:36 dcim -> /storage/emulated/0/DCIM lrwxrwxrwx 1 u0_a101 u0_a101 28 Jul 19 16:36 downloads -> /storage/emulated/0/Download lrwxrwxrwx 1 u0_a101 u0_a101 26 Jul 19 16:36 movies -> /storage/emulated/0/Movies lrwxrwxrwx 1 u0_a101 u0_a101 25 Jul 19 16:36 music -> /storage/emulated/0/Music lrwxrwxrwx 1 u0_a101 u0_a101 28 Jul 19 16:36 pictures -> /storage/emulated/0/Pictures lrwxrwxrwx 1 u0_a101 u0_a101 19 Jul 19 16:36 shared -> /storage/emulated/0 |
Reference:
Termux - How do I create a directory of files accessible outside of Termux?
沒有留言:
張貼留言