While I was really excited when i encountered it, I didn't find any practical uses.
While I was really excited when i encountered it, I didn't find any practical uses.
On my tablet, I used it as an ssh client.
On my VR headset, I used it to create a self-contained development environment: https://www.reddit.com/r/cyberDeck/comments/fc5sfr/oculus_qu...
You can use its PRoot functionality to run various Linux distros: https://wiki.termux.com/wiki/PRoot
And you can run Linux GUI apps if they are compiled properly: https://github.com/adi1090x/termux-desktop
Scenario 1: You're in the middle of your data center. Internal tools/tests say that $service is running correctly, but external customers says it isn't working, and firewall won't let you use an external IP without having to run 3 floors away on the other side of the building.
Solution 1: Open termux, and running telnet aaa.bbb.ccc.ddd $PORT and test
Quicker then waiting for a co-worker to get back to you on Slack.
Scenario 2: You are setting up a new VPN server and want to confirm that your outgoing connections are being routed through the correct IPs/Gateways.
Solution 2: Open termux and run tracert and see where you are being routed.
and many more....... I used to own a Nokia N900. Having a Linux CLI that works in portable device (wifi + cellular) is so damn handy. I use it atleast 2 times a week. It's a perfect diagnosing tool for OOB troubleshooting.
With ssh-copy-id it takes a single command (1-line script) to rsync the phone's DCIM directory to my main machine for further processing. Nothing needs to be done on the phone at all other than to lightly nudge it to wake it up so sshd sees the connection attempt.
Downside: Android security clampdowns mean termux can't see the SD card. So I can only sync down the phone's internal camera directory and that's where I have to store the new pictures and videos. This means space occasionally runs low and I have to move stuff to the SD card. But in the future, they probably won't allow Termux to even work any more in its current form - no "exec" of executables that werent' installed as part of the apk.
Why do all this? Because I'm old school. My phone is an extension of my data ecosystem, which lives on (redundant and backed-up) hard disks in my home computing setup. I don't even let the phone sync the photos to the cloud.
Admittedly I've found no other practical uses for it; all the interesting stuff is blocked by Android security (e.g. back up or otherwise process your call/SMS history).
Resilio Sync: use it in backup mode to sync photos to your desktop pc/mac/nas. Delete photos from phone when you want to free space. Also lets you access and edit normal files, either on demand or by sync. https://play.google.com/store/apps/details?id=com.resilio.sy...
PhotoSync: sync your photos to pretty much anything. https://www.photosync-app.com/home.html
Termux, ssh and rsync. Thats it. It works. I tell my phone, try to rsync when its been charging for at least 5 minutes and its evening time. Hurray.
Whereas the rsync method is exactly this: "syncphone" on my main machine. If it doesn't connect, nudge the phone so it wakes up (it'll connect anyway eventually; the phone seems to wake up on its own now and then). And then it's all automatic and scriptable from that point. I realize that perhaps 0.1% of smartphone users have the skills to automate things at that level and therefore care.
The auto rsync when charging is a good idea. I guess Termux can still get access to the battery/charge state?
Another example of user hostility: While on Android phones, at least older ones, bulk transfer of files via USB to/from a Linux machine has always been hit and miss, it's been rock solid on iDevices. Just do "idevicepair" and after that, transfer away to your heart's content, fast and solid. Only now I read that the latest version of IOS may have messed that up too, in the name of security of course.
Not sure that's what's causing it; I can definitely scp files from my Android phone's SDCard to my servers. But I've not tried initiating the scp from the other machine to my phone.
Anyway what's left of filesystem access for Termux isn't really a blacklist as in "you're forbidden to go here" but rather feels like a whitelist. There are a few carefully selected places you're still allowed to go, front and center being the DCIM directory.
Certainly, when I unlocked a Sony Xperia XA2 it did something similar where it won't ever get OEM updates ever again.
People also use it on chromebooks for dev work that doesn't require low level compiling. I have seen NPM and webdev work being done using termux and I have seen people use it for Jupyter Notebooks too.
It also integrates with Tasker (another android automation app).
Termux-api used to offer this [0], but apparently some time ago google decided to make it impossible:
> Usage of this API is no longer allowed by Google and we had to disable it to prevent delisting of Termux:API application from the Google Play.
It's my device, my SMS plan over a (supposedly) open source system. But it's the vendor's platform, and a huge part of it is proprietary (the play services).
This is the windows monopoly all over again, but in our pockets and with deep analytics backed in.
OK sorry, this ended being a rant. Is there an escape hatch? When will we have a credible free software mobile operating system?
Check out the devices[0] list on the postmarketOS wiki to see which Android phones and other things have support. In general none of them will work as well as the PinePhone, because Pine isn't fighting this sort of thing the way most manufacturers are, but it could be a fun thing to look into if you own anything already supported. You could also port it to a device not yet on the list if you're up for it.
Discussed in termux-api issue #257: https://github.com/termux/termux-api/issues/257
Unless you build it yourself with the functionality restored, you can't use it. Termux maintainers are just that dedicated to targeting Google Play first.
- grabbing albums off my PC with sftp
- easy way to unzip files
- play audio via mpv
- run `xdg-open` on a file and get a native popup to select an app to open it with
- ssh into your other machines, works well to pick up your irc chat away from your pc if you use irssi + tmux (or weechat, or screen, etc.)
- use a "real" editor like vim or emacs locally on your phone
- api stuff, you can control the torch, notifications, etc. you can make scripts around that (imagine a simple `sleep 30m && ...` sort of one liner that turns on your light and plays some audio to wake you from a nap (I haven't done much with this part of termux)
General: Using T-UI because I'm not a fan of modern touch UIs, but it is limited to Android functions like messages and launching apps. Anything beyond that (SSH, text editing, web calls, etc) I do through Termux. I wish I could combine the two more seamlessly, but it's effortless to switch between the two.
Learning: Wanted to learn to use vim. Termux provided simple vim access and vimtutor. I've also used Termux to freshen up on languages and write a few scripts. Namely, differences between Python2.7 to Python3 which I didn't look into until this year. Starting on C and/or Rust soon.
There's a widget addon that makes doing those sorts of things one-tap: https://wiki.termux.com/wiki/Termux:Widget
Though naturally once I created a widget to kick apache, it never failed again.
Persistent SSH session to a server running Weechat for IRC
(Remember to run 'pkg update' every so often, a recent update to the app required a reinstall or manual fix for anyone like me who didn't know it could be a problem)
Primary usage is via Samsung DeX so I have multiple windows and a proper mechanical keyboard.
I'm not the only weirdo who does this! Although I manage to get by with Hacker's Keyboard.
- Having a backup of my private repos and dot files that's always with me. Easily keep them up to date with a pull every now and then.
- Occasionally do some lightweight symbolic math or high precision arithmetic with Emacs' calc.
- Test the portability of a library I've been writing by building and running its test suite on a lower-powered ARM environment.
ssh -L 8080:172.383.20.18:8080
Secondary: Study programming - I am a self-taught programmer, and before the pandemic I would study a lot on public transit, in coffee shops, while waiting for people etc. This actually used to be the primary use case before I started working as a professional programmer and was also using breaks to study. Android/Termux is not really suitable for actual dev work (e.g. you'll probably need Docker at some point if you're doing backend, and you'll want a browser with dev tools for frontend), but for limited study projects (especially backend dev) it's absolutely awesome.
It's also my SSH client to access a few servers I keep privately, but this is a feature that certain dedicated apps (e.g. JuiceSSH) could do equally well or better, and I'm just using Termux because I already have it.
- a local bookmark manager and search redirector that i wrote in Go (much easier to just run in termux than turning it into an Android app)
- sshd to allow adhoc file transfer and command execution over ssh, getting various information from the phone using the termux cli APIs
- random shell stuff although i tend to do most of that over the ssh connection.
https://news.ycombinator.com/item?id=20660301
So I can copy photos from phone to laptop and post process with a script.
Things that don't rise to the level of deserving an app, but are nice to have.
ssh is the most used for me because I don't want to use Termius (paid) or some other SSH wrapper app. Termux is free, allows you to easily create ssh keys and use ssh-copy-id.
Emacs, org-mode, git and ssh. That's pretty much it, but allows me to have access to my org-mode files anywhere, just like on desktop.
But I'm also one of those weirdos who runs his own email server and sshes in to read mail in mutt.
A script running rsync over SSH over wi-fi works every time. And as I use rsync for backups generally (have done for many years) this integrates nicely with my general way of doing things.
I've not tried running SSHd to allow things to be pulled off or pushed to devices, but others report that working well too.