[HN Gopher] Termux is an Android terminal emulator and Linux env...
       ___________________________________________________________________
        
       Termux is an Android terminal emulator and Linux environment app
        
       Author : thunderbong
       Score  : 244 points
       Date   : 2023-04-29 13:38 UTC (9 hours ago)
        
 (HTM) web link (termux.dev)
 (TXT) w3m dump (termux.dev)
        
       | ykonstant wrote:
       | I have been using termux on my tablet for work and it runs very
       | well; I had taken a screenshot some time ago for reddit:
       | 
       | https://i.redd.it/p5h7ongm51541.jpg
        
       | nologic01 wrote:
       | Termux integrating the Python ecosystem [1] offers a glimpse of
       | an alternative universe, where mobile devices are far more
       | empowered.
       | 
       | [1] https://wiki.termux.com/wiki/Python
        
         | pjmlp wrote:
         | Pydroid exists and is a much better experience.
        
       | dang wrote:
       | Related:
       | 
       |  _Termux on Android 5 or 6_ -
       | https://news.ycombinator.com/item?id=33691293 - Nov 2022 (119
       | comments)
       | 
       |  _Termux - An Android terminal emulator and Linux environment on
       | your phone_ - https://news.ycombinator.com/item?id=32648424 - Aug
       | 2022 (2 comments)
       | 
       |  _Why is the Play Store blocking updates for Termux but not
       | UserLAnd?_ - https://news.ycombinator.com/item?id=28815910 - Oct
       | 2021 (2 comments)
       | 
       |  _Termux no longer updated on Google Play_ -
       | https://news.ycombinator.com/item?id=25644964 - Jan 2021 (340
       | comments)
       | 
       |  _Termux is an Android terminal emulator and Linux environment
       | app with no rooting_ -
       | https://news.ycombinator.com/item?id=24979258 - Nov 2020 (208
       | comments)
       | 
       |  _Termux and Android 10_ -
       | https://news.ycombinator.com/item?id=23224669 - May 2020 (314
       | comments)
       | 
       |  _Termux: terminal emulator and Debian-style userland as an
       | Android app_ - https://news.ycombinator.com/item?id=15529426 -
       | Oct 2017 (139 comments)
       | 
       |  _Termux: terminal emulator and Linux environment for Android_ -
       | https://news.ycombinator.com/item?id=11570596 - April 2016 (5
       | comments)
       | 
       |  _Show HN: Termux - Terminal emulator and Unix environment for
       | Android_ - https://news.ycombinator.com/item?id=9905391 - July
       | 2015 (28 comments)
        
       | cft wrote:
       | I have been struggling with termux on Android 13 pixel 6 pro.
       | Whenever I edit a picture with ffmpeg, it's invisible to the
       | normal Photos app.
        
         | cfiggers wrote:
         | Termux uses a sandboxed file system by default, but you can
         | give it access to the rest of the phone's shared files by
         | running `termux-setup-storage` from within Termux (more details
         | at: https://wiki.termux.com/wiki/Termux-setup-storage).
         | 
         | That'll mount a new folder called "storage" in your home
         | directory where you can place files in locations where other
         | apps can see them.
        
           | cft wrote:
           | I have done that, the files are created in their normal
           | locations where the rest of the photos are. But the files
           | created by ffmpeg don't have the execute x permission bit set
           | and I think because of that they're invisible in the photos
           | app.
        
             | freedomben wrote:
             | Forgive the possibly obvious question, but have you tried
             | `chmod +x` ing the ffmpeg output files with termux?
        
               | cft wrote:
               | Yes, it returns successfully but the x bit is not set
        
           | pjmlp wrote:
           | That doesn't work any more in modern Android, unless SAF is
           | used for communication between applications to access private
           | data.
        
       | ekvintroj wrote:
       | it's pretty sad to have such a powerful computers in our pockets
       | and not being able to use as we want, even to be forced to
       | discard them just because it wont get any updates.
        
       | retrocryptid wrote:
       | I _sometimes_ run org mode in emacs under termux on my phone.
       | After getting fed up with crap in simple list apps, my grocery
       | list is a file in termux.
        
         | JamesonNetworks wrote:
         | The Home Assistant built in grocery store list maker is amazing
        
         | Jeff_Brown wrote:
         | Emacs on Termux is great. I have used org mode, shell mode,
         | magit (for git), and even eww (the Emacs Web Wowser) to great
         | effect in it.
        
       | arendtio wrote:
       | I like Termux, but most of the time I use a real PC, because of
       | the better UX. However, together with Samsung Dex most of the
       | usability problems disappear and you can use your phone as a work
       | station.
       | 
       | Sometimes when I don't want to start a PC I just connect my phone
       | to my USB-C docking station and Termux has most of the tools that
       | I need to get something done.
        
       | VikingCoder wrote:
       | Termux sent me down a rabbit hole of trying to figure out the
       | cheapest computer that I could legitimately recommend to someone
       | as a learning computer.
       | 
       | I found $18 Android phones on clearance at Walmart, like the
       | TracFone - Alcatel One Touch Pixi Unite with 8GB Memory Prepaid
       | Cell Phone - Black. I mean, look at the specs:
       | 
       | * 1500 mAh Battery, 800x480 screen
       | 
       | * Quad-core 1.3GHz processor with 1GB of RAM
       | 
       | * Android 6.0 Marshmallow OS
       | 
       | * 3G data speed for fast Web browsing and multimedia downloads
       | 
       | * 3.97" TFT color display
       | 
       | * 2.0MP camera
       | 
       | * 8GB internal memory plus microSD slot
       | 
       | * Expand storage up to 32GB by adding a microSD card (sold
       | separately).
       | 
       | I mean, compare it to a Mac Classic - with this little
       | infographic I made: https://i.imgur.com/7UJjRuc.png
       | 
       | You just would never use the data plan. On wifi, it worked great.
       | So, go to a Starbucks, McDonalds, or Library... And you're coding
       | in basically a real Linux for $18. (!)
       | 
       | This thing was particularly impressive, at $56.20, the RCA
       | Voyager Pro 7 16GB Tablet with Keyboard Case Android 6.0
       | (Marshmallow) in Charcoal (RCT6873W42KC M).
       | https://www.amazon.com/gp/product/B01M7TSY16
       | 
       | This $90 one seems like a reasonable alternative: RCA Atlas 10
       | Pro (RCT6B06P23H) 10 Inch Android 9 Tablet with Keyboard Black
       | (Renewed). https://www.amazon.com/RCA-RCT6B06P23H-Android-
       | Keyboard-Rene...
       | 
       | And then Chromebooks, of course. At the time I was loving my $169
       | Samsung Chromebook 3 with 4 GB of RAM from Best Buy. Termux runs
       | great. Loved this machine - I used it all the time. I also played
       | with GalliumOS, which requires "rooting" to Developer Mode. I
       | have a Samsung 128GB USB Drive, and a 16 GB microSD card, and
       | both seem to work. I use a mouse, sometimes. Android Apps were a
       | little dodgy - the mouse turned into a black square, sometimes,
       | for instance. And this was even before they offered a full Linux
       | shell on Chrome! Now it's far easier, of course.
        
       | netfortius wrote:
       | This is on the top 5 list of my favorite android apps, every time
       | such question comes up in a forum. I complement such with what I
       | install under it (e.g. nmap, wget, curl, dns tools, various
       | network utilities, whois, openssh, etc.)
        
         | newswasboring wrote:
         | Would love to know what your other 4 are.
        
       | [deleted]
        
       | squarefoot wrote:
       | I've given up on Android and smartphones ages ago. Today am a
       | happy dumb phone user and intrigued only by the Pinetab 2,
       | however I played with Termux on old devices and loved it; that
       | was really close to having the real thing under the hood.
       | Unfortunately my best tablet, a supposedly crappy no-name wifi-
       | only one which was like a gift for buying something else but it's
       | incredibly fast and much snappier than bigger ones, runs only
       | Android 4.x (yeah, I know, that's pretty much retrocomputing:^)
       | so it's not supported.
        
       | aidog wrote:
       | I update my website by writing it in the Squircle CE editor and
       | then run my static sitegenerator, commit and push to the server
       | by pressing a termux homescreen shortcut. Works great. Images are
       | a bit of an issue, but I have another termux script that's run
       | when use the android "open with" menu and select termux on an
       | image.
       | 
       | If anyone has a better idea how I can get images into the
       | filesystem from an editor in android, let me know.
       | 
       | PS: Some light ChatGPT copy paste coding also works great. My
       | foldable keyboard mouse setup means I could code everywhere.
        
         | Ugohcet wrote:
         | You can use any file browser that supports android's document
         | api to browse termux's filesystem. If you are using something
         | like samsung oneui it can't do that, but you can install Anemo
         | and use its shortcut to open android's default "Files" instead
         | of samsung's
        
           | Ugohcet wrote:
           | (Termux will appear on the left side bar beside "Internal
           | memory", sd cards and google drive)
        
       | yokem55 wrote:
       | Folks who want a more traditional linux environment and libraries
       | then what termux comes with might find proot-distro[1] to meet
       | their needs. Basically it allows running an actual arm linux
       | distro in a pseudo container created by (ab)using the ptrace
       | syscall to emulate root privileges. This has a fairly big
       | performance impact, but it works if you want to run arbitrary arm
       | linux binaries.
       | 
       | [1] https://github.com/termux/proot-distro
        
       | silleknarf wrote:
       | I can highly recommend it. Also, it's worth using f-droid to
       | install because otherwise you can't get the latest version.
       | 
       | Until I discovered termux, I would have always be on the lookout
       | for new git client / ssh client apps. Now I have a fairly good
       | dev env on my phone. Git and vim get me pretty far in that
       | regard. Python and node were easy enough to set up. Recently, I
       | set up nvim so I can use GitHub Copilot and I think it's
       | particularly helpful on mobile.
       | 
       | Most of my personal projects run in containers. I know it is
       | possible to get docker set up on Android. However, it is
       | apparently pretty slow and it doesn't look totally
       | straightforward to get working so I haven't tried that yet.
       | 
       | A few years time and hopefully I'll be running docker containers
       | and maybe VS code will become a solid option on mobile too.
        
         | freedomben wrote:
         | As an aside, vim on Termux is not nearly as difficult/awkward
         | as one might think. Of course you can plug in a keyboard to the
         | USB port wired/wireless with dongle or via bluetooth, but even
         | without it I find vim's modal editing with a focus on keystroke
         | golf (e.g. fewest keystrokes possible) to be a boon for finger-
         | pecking out on a soft keyboard. For doubters, don't knock it
         | til you try it!
        
       | mastax wrote:
       | Because it wasn't obvious to me for a while: the Play store
       | version is old, basically broken, and vulnerable [0]. Don't
       | install it. The description does mention this relatively high up,
       | but do you really read through the description for something
       | before installing and playing around with it, especially if you
       | already know what it is?
       | 
       | I don't usually like having old versions of software removed from
       | distribution, but maybe in this case it should be removed from
       | the play store since it's basically useless and also vulnerable.
       | 
       | [0]: https://termux.dev/en/posts/general/2022/02/15/termux-
       | apps-v...
        
         | [deleted]
        
         | cloudripper wrote:
         | Thanks for posting this. I don't know how difficult it is to
         | get an app removed from the Play Store - but hope it can be
         | done soon.
         | 
         | From README - "There are plans for unpublishing the Termux app
         | and all its plugins on Play Store soon so that new users cannot
         | install it and for disabling the Termux apps with updates so
         | that existing users cannot continue using outdated versions.
         | You are encouraged to move to F-Droid or GitHub builds as soon
         | as possible."
         | 
         | Vulnerability Disclosure was made on 2/15/2022 [0]. Above text
         | was added to README.md in 9/8/2021 commit [1]. The issue was
         | first acknowledged in README in 4/26/2021 commit [2].
         | 
         | [0]: https://github.com/termux/termux-app/issues/2595
         | 
         | [1]: https://github.com/termux/termux-
         | app/commit/94e01d68d6c91574...
         | 
         | [2]: https://github.com/termux/termux-
         | app/commit/93e1b132786d5cc7...
        
       | dredmorbius wrote:
       | The Only App Which Does Not Specifically and Precisely Suck[tm].
       | 
       | I don't know whether I should be grateful to Termux for making
       | Android remotely bearable, or vexed that it's enabling a platform
       | I despise.
       | 
       | But on its own merits, Termux is amazing, profoundly useful,
       | powerful, and a breath of fresh air.
       | 
       |  _Do install from F-Droid_ , not Google Play Store, as others
       | note.
       | 
       | And yes, _of course_ it 's _more_ useful with an actual hardware
       | keyboard (Bluetooth), as is Android generally. But it 's _usable_
       | and _useful_ even when using the onscreen soft keyboard. (Hacker
       | 's Keyboard FTFW.)
       | 
       | You can also run the available sshd service and access your
       | mobile device remotely.
       | 
       | And yes, I mention and advocate Termux frequently on HN:
       | <https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...>
        
         | freedomben wrote:
         | > _vexed that it 's enabling a platform I despise._
         | 
         | Do you despise Android? How come? What's your preferred
         | alternative?
        
       | cosmiccatnap wrote:
       | Story Time
       | 
       | I was an IT person for the math building while I was in college
       | and I was mining a newish crypto called doggo on a computer lab
       | while everyone was out for the summer. I had approval to do it
       | and it was going to turn off as soon as the semester started back
       | but they all had workstation cards and I couldn't resist. A man
       | had offered to sell me a 99 civic if I got 200k and I needed a
       | car.
       | 
       | Cut to weeks later and I'm hundreds of miles away for the day
       | eating and drinking at a vitnamese restaurant with some friends
       | and I get some notifications that the mining stopped.
       | 
       | I wasn't worried or afraid though because I knew in my pocket I
       | could just pull out my android and click the magic button,
       | Termux, to get a friendly and sensible shell with which to fix
       | whatever mess had been thrown my way.
       | 
       | It was over in 5 minutes, I just rebooted them, process continued
       | and I kept eating my noodles. Couldn't recommend it enough.
       | 
       | I had 300k by winter break and I had been set to meet the person
       | for the civic after Christmas but that holiday a bunch of
       | people's wallet got hacked and mine was no exception.
       | 
       | I ended up getting a card eventually but it wasn't the 99 civic
       | -_-.
       | 
       | Termux on the other hand has been on every phone ive owned since
        
       | schemescape wrote:
       | Is there any sort of reputable, non-subscription (and open
       | source, while I'm listing wishes) SSH client for iOS/iPhone?
       | 
       | I ran across Blink (which is subscription-only) and Prompt ($15
       | ---not unreasonable if you're sure you'll use it often), but I'm
       | curious to hear recommendations from here.
        
       | knaik94 wrote:
       | Termux singlehandedly makes me feel like I'm living my childhood
       | dream of having a full computer in my pocket. I use git to blog
       | from my phone, I have ffmpeg and yt-dlp installed to download
       | videos for when I am going to be away from internet access for a
       | while, and I even have some home automation scripts setup that
       | control the lights over the local network. But I am concerned
       | about the direction Android is headed, Google policies have been
       | aligning closer to Apple's. I don't like having to stay on a
       | previous generation OS just to make sure I don't lose "power
       | user" fuctionality. Just recently I had to install a root mod to
       | allow apps complete access to SD cards, a recent update caused me
       | to get the dreaded "To protect your privacy, choose another
       | folder" while trying to give a gallery app permissions. I am
       | grateful for Termux devs for working hard to maintain
       | functionality via workarounds.
       | 
       | https://github.com/termux/termux-app/issues/2366
        
         | orbisvicis wrote:
         | Why would I want to install termux? You basically need a
         | keyboard to use it; at which point you might as well grab a
         | laptop.
        
           | derekzhouzhen wrote:
           | Because I don't want or can't use my shitty corporate issued
           | laptop to access my personal projects from work.
        
           | colordrops wrote:
           | It has additional keys above the standard keyboard for tabs,
           | Ctrl, arrow keys etc. It also has good scroll support, even
           | in vim. Definitely fine for quick jobs.
        
           | freedomben wrote:
           | I mainly use termux for the script API (which is incredible
           | btw). I usually write the scripts in bash or ruby on my
           | computer and scp them over, but I also have a small keyboard
           | that I can plug in to type directly on the phone.
           | 
           | Even if you don't use the CLI part of Termux often, it's
           | still an incredibly neat piece of hackery goodness. I once
           | needed to text about 50 people and have it be from my real
           | phone number. Rather than hack around with Twilio or AWS, I
           | spent 5 minutes writing a ruby script to send the texts from
           | Termux. If you aren't familiar yet with the API, it will take
           | a little longer than 5 mins the first time. Once I had that
           | script, I kept finding neat usecases for it. I sometimes
           | still just text from the CLI because it's easier than using
           | the built-in messages app depending on what I'm doing.
           | 
           | You can definitely get an amazing experience on Android
           | without Termux, but Termux is like if Android were a really
           | nice bicycle, Termux is a small powered motor you can bolt on
           | somewhere to automate parts of your life.
           | 
           | Aside: I find Termux easier to use than Tasker. I'm a CLI
           | native old man though, so don't take this as a knock against
           | Tasker.
        
           | jchw wrote:
           | You do not! You can use volume down as a Ctrl key, and volume
           | up also unlocks other keys (volume up + wasd for example
           | gives you arrows.) It also gives you an extra row above the
           | touch keyboard with escape, tab, and some other keys, and a
           | text input for pasting/IME/swiping/etc.
           | 
           | And even if that sounds uncomfortable there's still plenty of
           | useful things you can do with minimal typing! For example...
           | You could run Tailscale as a normal Android app, then use SSH
           | forwarding in Termux to get a local port that goes to a web
           | server on another computer in your tailnet, and browse to
           | that locally on the phone using Fennec F-Droid (Firefox). All
           | of that works just fine. If I leave one of my computers on
           | and I'm in bed or away from home I can ssh in and run
           | systemctl suspend. Wayland/X server locked up? You can use
           | your magic sysrq keys of course, OR you can ssh in with
           | termux and kill it, which doesn't depend on magic sysrq being
           | enabled (or remembering how to get it on your keyboard.) You
           | could also run yt-dlp to download some video or audio content
           | from the internet; everyone hates the Reddit video player, so
           | why not just get the MP4 out of it? Admittedly, there's a
           | better solution here: you can get an app called Seal on
           | F-Droid which is a pretty good yt-dlp frontend. But, the fact
           | that you can easily do it in Termux using their package
           | manager is testament to just how useful Termux is.
           | 
           | I honestly only want one thing; an SSH Agent implementation
           | built into the app, so I can import SSH keys and not have to
           | enter the passphrase constantly. Not a huge deal really, but
           | having a built-in agent would be super convenient.
        
           | hungryforcodes wrote:
           | There is quite a difference in size there! Find me a 7 inch
           | laptop with phone battery life and pocket availabilty.
        
             | jchw wrote:
             | The closest option is probably the GPD MicroPC. It's 6",
             | but pretty damn close to the ideal of a truly tiny PC. I
             | think they're making a successor to this finally, dunno
             | what the status is.
             | 
             | https://www.gpd.hk/gpdmicropc
        
               | hungryforcodes wrote:
               | Thanks for the link. It looks pretty cool. Form fact wise
               | it looks to be competitive with an Android phone and a
               | portable keyboard. So it's not clear immediately which is
               | better.
               | 
               | I use termux daily, and you can stand up pretty much
               | anything including a production grade PostgresDB. It's
               | not a toy.
        
             | Chris660 wrote:
             | As an ex Psion 5 user, I've often been tempted by the
             | devices from Planet Computers:
             | https://store.planetcom.co.uk/products/gemini-pda-1
        
               | pxc wrote:
               | The keyboards on them are excellent, but the
               | software/firmware stories for their devices are awful.
               | Frozen kernels due to proprietary blobs, and support for
               | running full Linux distros is limited and lags by months
               | to years. And they're expensive as hell.
               | 
               | But they keyboards are good enough that I'd still kinda
               | like to try the Astro Slide 5G. I just don't want to
               | order one only to wait years for it to arrive.
        
           | knaik94 wrote:
           | Termux allows the same kind of scripting ability you would
           | expect from a desktop. Termux-api almost rivals tasker in
           | what you can automate with it. I use the "share with termux"
           | function and git pull/push shortcuts more than anything else,
           | and they are both effectively 1 touch functions. The share
           | with termux function allows you to script how termux will
           | respond to shared urls, I have it set up to auto-start yt-dlp
           | and fill in certain formats and details and starts
           | downloading. It was a little bit inconvenient to set up, but
           | I managed without a fullsized keyboard. There's an app called
           | hacker keyboard that makes it easy.
           | 
           | The original script I wrote was initially set up with
           | youtube-dl, the most recent change was to yt-dlp. For a lot
           | of little things, like to SSH/reboot my rpi, wget a link I
           | want to archive/send, small python programs (and yt-dlp), the
           | keyboard is perfectly adequate. I've even converted a couple
           | of audio files to send to a friend on iOS, from opus to mp3
           | on the phone. Bash alias are really useful, and because the
           | phone isn't also general use, they can be very specific.
           | 
           | Termux also makes the phone into a very powerful network
           | diagnostics and pen testing tool. But even something as basic
           | as ifconfig makes my phone feel as powerful as a computer.
           | https://github.com/may215/awesome-termux-hacking
           | 
           | Chromebooks have the ability to install and run android apps.
           | The lightweight environment afforded by Termux is perfect for
           | them. I do use VIM with my chromebook. I know I can use
           | crostini, and in the past I was running crouton, but I
           | realized I can handle 99% of those things in termux, and I
           | can use VSCODE dev for the remaining 1%. I appreciate how
           | much more flexibility termux gives me.
           | 
           | https://wiki.termux.com/wiki/Termux:API
           | 
           | https://github.com/klausw/hackerskeyboard
        
           | Ugohcet wrote:
           | You don't. I almost always use termux with virtual keyboard
           | and it feels fine for doing something quick and on the go.
           | Modal UIs (like vim) work better than modifier- and
           | functional keys-heavy though.
        
           | anthk wrote:
           | You can SSH to your phone and rnu tmux and ffmpeg on it,
           | which is more powerful than my netbook.
        
           | skrowl wrote:
           | [dead]
        
           | qbasic_forever wrote:
           | You really don't need a keyboard, I use it just fine with
           | onscreen and even wrote some simple scripts in vim with it.
           | Tab completion in the shell helps a lot too and termux's
           | keyboard has a button for it right there.
           | 
           | But if you _do_ need a keyboard... it's android and it
           | perfectly supports USB or Bluetooth input devices including
           | mice, keyboards, etc. If you have a Samsung or some other
           | devices you can even get a nice HDMI output to a monitor and
           | desktop experience out of the box. It's really like a little
           | laptop in your pocket at all times.
           | 
           | And if you need a GUI Termux runs X11, vnc, etc and GUI apps
           | just fine. Just download a X11 server or vnc app from the
           | play store (there are tons) and you're good to go.
        
         | rektide wrote:
         | > _But I am concerned about the direction Android is headed,_
         | 
         | Over securing systems seems to be the modern trend, and mercy,
         | it's such suffocating paternalism.
         | 
         | We have incredible phones and Android/Google just keeps making
         | them less and less capable.
        
         | fsflover wrote:
         | > feel like I'm living my childhood dream of having a full
         | computer in my pocket
         | 
         | While Android can provide such feel, GNU/Linux smartphones
         | (Librem 5 and Pinephone) _are_ such computers. And they do not
         | depend on Google in any way. (I 'm a happy owner of both.)
        
           | knaik94 wrote:
           | I understand the sentiment, but I disagree. From the last
           | time I checked, the big compromise with GNU/Linux phones is
           | still the lack of social media and messaging apps and
           | appstore ecosystem. Android, with root, is every bit as much
           | a computer as a Pinephone and Librem 5, but the opposite
           | isn't true. Termux has PRoot, a user-space implementation of
           | chroot allowing a full distro install. I personally don't
           | have any problem depending on Google, I have a problem with
           | things being locked away with no alternative. Given the
           | option, I will happily accept the risks and void my warray to
           | root.
           | 
           | https://wiki.termux.com/wiki/PRoot
        
             | fsflover wrote:
             | > Android, with root, is every bit as much a computer
             | 
             | Can you install a _completely_ different OS on your Android
             | phone? AFAIK no, whereas on Pinephone you can choose among
             | 15+ systems and on Librem 5 currently among 4 or more. What
             | about installing a mainline kernel?
             | 
             | > lack of social media and messaging apps
             | 
             | You can use Waydroid for Android apps, or install one of a
             | few Matrix and Mastodon clients. Telegram works, too. Also,
             | Flatpak apps work natively.
             | 
             | > I personally don't have any problem depending on Google,
             | I have a problem with things being locked away with no
             | alternative
             | 
             | To me these sound like the same problem. Google is
             | restricting your freedom, not someone else.
        
         | pjmlp wrote:
         | They can switch to provide an UNIX like experience rewritten in
         | Java/Kotlin instead, CLI and stuff, their option.
         | 
         | Google has been quite clear since NDK was introduced in Android
         | 2.0, that is only for games and native methods implementations.
        
         | jgtrosh wrote:
         | > I have ffmpeg and yt-dlp installed to download videos for
         | when I am going to be away from internet access for a while
         | 
         | Have you tried NewPipe for that use case?
        
         | walrus01 wrote:
         | > Termux singlehandedly makes me feel like I'm living my
         | childhood dream of having a full computer in my pocket
         | 
         | I still remember the first time I successfully SSHed to
         | something from my Handspring Treo 180 over GPRS data, and felt
         | like I was living in some kind of cyberpunk future.
        
         | noman-land wrote:
         | You should check out GrapheneOS as an alternative to regular
         | Android.
        
         | peterhadlaw wrote:
         | FWIW I ran into the "To protect your privacy..." thing when
         | using Syncthing. I was able to manually specify the path to one
         | of those "protected" folders in the text input. It worked.
         | Might be just the native file picker that's protecting users
         | from granting access to folders albeit in a very shallow
         | manner.
        
           | knaik94 wrote:
           | The restrictions are regarding specifying the root folders,
           | /emulated/0 and /sdcard as well as android/data and /obb
           | folders. You are able to pick folders, other than data and
           | obb, manually one by one but that would be over a hundred
           | folders on my sdcard to use a gallery app. The /data and /obb
           | folders are inaccessible to users even though it's in user
           | space. As of android 13, third party apps can't open /data or
           | /obb, you have to install an app that creates a shortcut to
           | the hidden AOSP files app and drag/drop manually. Rooting/usb
           | gives you access, but play store guidelines about android app
           | api targets make things difficult for third party apps.
           | 
           | By "protecting" users from security threats, they are pushing
           | power users to daily drive a rooted device, which is a bigger
           | security risk. I expect incomplete/broken file storage access
           | from Apple devices, not Androids.
           | 
           | The thing I hate the most is that certain apps only store
           | files in their respective android/data/ folder and delete
           | that data on uninstall. These workarounds are the only way to
           | backup that data.
           | 
           | https://www.reddit.com/r/Android/comments/j3zgmm/managing_fi.
           | ..
        
         | routerl wrote:
         | > But I am concerned about the direction Android is headed
         | 
         | I'm with you, but we'll always have AOSP. And the cellphone
         | market is now segmented enough that we'll probably also always
         | have rootable phones.
        
           | knaik94 wrote:
           | One of the most unfortunate things in the US is locked
           | bootloaders. AT&T has even started whitelisting phones for
           | Wifi Calling and VoLTE. And with 3g shutting down, it means
           | international phone variants won't work at all on the
           | network, regardless of the underlying band support. Many
           | companies, including Samsung don't allow you to unlock your
           | bootloader to root your phone even if you bought it outright.
           | I found that midrange phones are now the best option if you
           | want things like AOSP. The only true flagship left, that I
           | know of, with a headphone jack and sd card and good rooting
           | support is the Sony Xperia phones.
        
           | solarkraft wrote:
           | We'll always have the versions of AOSP Google has released,
           | but they're not forced to do so in the future. And I'm not
           | sure anyone else is interested in maintaining it.
        
             | ta8903 wrote:
             | Google only releases AOSP for Pixel devices, for most
             | devices you need to rely on (and trust) some dude on a
             | forum and it might not have 100% compatibility.
        
           | Ruq wrote:
           | Ironically, I specifically have a Google Pixel so that I can
           | mod it and gain more control over my phone.
        
             | anony23 wrote:
             | What are some examples of these types of mods?
        
               | alewi481 wrote:
               | Custom ROMs? GrapheneOS or LineageOS come to mind.
        
           | kragen wrote:
           | is anybody outside of google able to maintain aosp though
        
         | rootw0rm wrote:
         | I felt the same way when I got my Nokia N900 back in the day
        
         | qbasic_forever wrote:
         | I really wish Android would properly enable containers like
         | they've done for Chrome OS. It's silly we run little Linux
         | machines and can't pop a fully isolated container shell on
         | them!
        
           | derefr wrote:
           | I _think_ it hasn 't happened because much of the sandboxing
           | of Android is part of the Android runtime, thereby only
           | sandboxing code compiled _for_ the Android runtime. If you
           | could spawn a native Linux executable (that hasn 't been
           | compiled for Android the way the Termux executables have)
           | from an Android application, then that process can escape the
           | application's sandbox and do stuff it shouldn't be able to do
           | given the permissions granted to the Android application.
           | 
           | That just means no container-based virtualization, though.
           | There's nothing stopping a sufficiently-powerful Android
           | device from running a Linux _virtual machine_ , presuming
           | that the hypervisor is implemented as a regular Android
           | application using regular Android-runtime APIs.
        
             | ignoramous wrote:
             | Android 13+ includes a _crosvm_ based virtulization setup:
             | https://source.android.com/docs/core/virtualization
             | 
             | > _...then that process can escape the application 's
             | sandbox and do stuff it shouldn't be able to do given the
             | permissions granted to the Android application._
             | 
             | Android's sandboxing is _not_ limited to ART and has
             | multiple layers [0]. Native apps cannot bypass sandboxing,
             | I don 't think.
             | 
             | [0] https://hernan.de/blog/tailoring-cve-2019-2215-to-
             | achieve-ro...
        
               | derefr wrote:
               | > Android 13+ includes a crosvm based virtulization setup
               | 
               | Interesting; but I feel that their choice of a
               | hypervisor-based design here supports my point of plain
               | container-based isolation (or even containers + gVisor)
               | being insufficient to achieve true sandboxing on Android.
               | 
               | > Android's sandboxing is not limited to ART and has
               | multiple layers [0]. Native apps cannot bypass
               | sandboxing, I don't think.
               | 
               | Yes, but when I say "sandboxing", I _mean_ just the ART
               | sandbox, not the other layers. I don 't care whether you
               | can get root / jailbreak the device. I (and presumably
               | Google, in not publishing apps that do this in the Play
               | Store) care about whether an application that, upon
               | installation, _doesn 't_ request permission to e.g. read
               | your contacts, can actually read your contacts. There are
               | certain capabilities like that (not sure if "reading your
               | contacts" is one of them, but you get the idea), that are
               | only prevented from being accessed by ART, not by Linux
               | ACLs. This is especially true when there's one level of
               | permission that gets you access to a certain database
               | file through an API, but then another level of permission
               | that gets you access to certain special _records_ in that
               | database file through the same API. The lower level of
               | permission is already granting you Linux filesystem ACLs
               | to the database file; the only difference between the two
               | permissions comes down to what ART will allow you to
               | request through the higher-level API.
        
               | pjmlp wrote:
               | It is prevented by killing any process that makes API
               | calls not part of the official set of public NDK APIs and
               | file locations.
               | 
               | Which is one of the reasons why Termux has issues on
               | modern Android versions.
               | 
               | https://github.com/termux/termux-packages/wiki/Termux-
               | and-An...
        
               | Zak wrote:
               | Google does, in fact publish apps that require root
               | access in the play store. Titanium Backup is a popular
               | example (though I'd recommend the open source Neo Backup
               | instead).
               | 
               | They presumably don't publish apps that use exploits to
               | help the user gain root without unlocking the bootloader
               | and wiping the data partition.
        
               | robotnikman wrote:
               | Now thats an app I miss using, but unfortunately its much
               | harder to get root on phones now, or if you do a lot of
               | functions like banking apps will not work.
               | 
               | Androids built in app backup functions are woefully
               | incomplete, and switching to a new phone recently I had
               | to relogin to most apps and re-set up nearly everything,
               | except for stuff like contacts and anything from google.
               | At least some apps supported exporting settings to
               | external files and allowed re-importing them.
        
               | Zak wrote:
               | It's rare I run into an app I want to use that has more
               | than trivial root detection, including my two banks. I
               | would probably change banks before giving up root or
               | mobile banking.
               | 
               | When I do run into apps that are difficult to run, I make
               | sure to give them 1-star reviews. I consider attempts to
               | block rooted devices from running an app to be malware.
        
               | skrowl wrote:
               | There are many file explorer apps ( MiXplorer is my
               | favorite https://play.google.com/store/apps/details?id=co
               | m.mixplorer.... ) on Google Play that have optional root
               | access as well. You can use it w/o root, but if you have
               | root it prompts for elevation and then lets you use it.
        
               | Zak wrote:
               | I also use MiXplorer, and wouldn't be able to read my
               | camera's SD cards on my phone without it because Android
               | doesn't support exfat for some reason. Root is required
               | for it to use its own filesystem drivers of course.
               | 
               | I don't think I knew it was on the Play store. It's a
               | free download from the website, but paid on the Play
               | store. I'd like to make a donation without giving Google
               | a cut - the author deserves to get paid.
        
             | moondev wrote:
             | If it works like crosvm on ChromeOS, you can launch a KVM
             | virtual machine and then run containers inside that. It
             | even supports nested virtualization (at least it does on my
             | framework Chromebook) so you can then run vms inside the VM
             | for stuff like multipass or gnome-boxes. It actually works
             | really. Would be amazing if this same pattern is enabled
             | for Android devices with proper vmx/vt extensions on the
             | CPU.
        
           | AviationAtom wrote:
           | Not quite the same, but interesting:
           | 
           | https://www.xda-developers.com/android-13-dp1-google-
           | pixel-6...
        
       | riogordo2go wrote:
       | Big Termux fan. From using my phone as a borg backup target (with
       | Wireguard) to ssh access to remote servers, it gives you a full
       | blown Linux environment in your pocket.
        
       | 1vuio0pswjnm7 wrote:
       | As passenger in a car where the driver is using Google Maps voice
       | navigation:                  termux-tts speak wow;termux-tts-
       | speak you are really lost
       | 
       | With termux we can create voice activated shell scripts, or
       | remotely cause the phone to take photos/record audio by sending
       | commands over SSH. I use Termux to compile commandline "apps"
       | using clang, as I do not care for "SDKs" or "IDEs".
       | 
       | As the top comment suggests, having some ability to control the
       | phone through Termux might make one skittish about installing "OS
       | updates" for fear it will remove some of that control.
       | 
       | Ever notice how all updates are now portrayed as for 100% for
       | "security" or "privacy", but never for the commercial gain of
       | certain companies. Another dark pattern. Termux is great but
       | these mobile OS remotely administered by so-called "tech"
       | companies really suck overall. We are kidding ourselves to think
       | we have any real control over these pocket-sized computers when a
       | third party, namely Google, can remotely install and run software
       | on them whenever it suits them.
       | 
       | Sure, we have pocket-sized computers, the hardware is impressive,
       | but these computers do not really belong to us because someone
       | else has control over them, after purchase.
        
       | a_e_k wrote:
       | Termux is great.
       | 
       | One of my favorite tricks is sharing a photo to it, then running
       | a quick `python -m http.server 8000` while on wifi. It makes it
       | dirt simple to send a photo from my phone to any local machine on
       | my network without the hassle of cloud services (including
       | generation loss from recompression), incompatible apps, bluetooth
       | pairing, etc.
        
         | timetraveller26 wrote:
         | kdeconnect is great for this too!
        
           | freedomben wrote:
           | Do you or anyone else know what the state of kdeconnect is on
           | gnome? Last I tried it out it didn't work super well and the
           | functionality was spread out among a handful of different
           | apps. If you didn't already know what you were looking for,
           | it was very difficult to discover what you can do.
        
             | cyberbanjo wrote:
             | KDE Connect is a standalone multi platform application, you
             | don't have to run KDE to use it (I don't).
             | 
             | Installing the gnome alternative was one package and I
             | killed X and started gnome-shell to test gsconnect it
             | appears to pair and allow remote input from my phone to my
             | PC and well enough, what doesn't work for you?
        
       | kqr wrote:
       | I have used termux for to SSH to various boxen in a pinch, but I
       | just recently realised it allows me to write and run arbitrary
       | scripts on my phone!
       | 
       | I can basically do (limited -- but sufficient for my needs)
       | Android programming without knowing a lick of Android. And I can
       | do it on the phone itself. Crazy that I didn't realise this
       | potential sooner.
        
         | freedomben wrote:
         | Yes! For me the real power of Termux emerged when I discovered
         | the API. tldr: most of the android API is accessible from
         | within Termux, and since you can install nearly any
         | interpreter/compiler you can write programs that target android
         | APIs from nearly any language! I personally love using Ruby for
         | this. It's a true automaters dream.
        
       | idatum wrote:
       | The combination of termux and scrcpy is pretty cool. Scrcpy is
       | currently being discussed as well:
       | https://news.ycombinator.com/item?id=35749366
       | 
       | I have one of those Bluetooth keyboards and mice that allow
       | multiple paired devices. There's a button on each to allow you to
       | switch. That's pretty handy to have it paired with my old Android
       | device and be able to pop over and use my tmux sessions.
        
         | freedomben wrote:
         | Oh dude! That's such a great idea. So great that (like most
         | great ideas) it's extremely obvious in hindsight and I feel
         | silly for not having considered it :-D
        
           | lugu wrote:
           | Humm, I am not getting it. Can you detail the setup you
           | envision? Thanks!
        
       | guestbest wrote:
       | I've put this on a 20$ android phone that I got on eBay and was
       | so impressed it made me consider switching from iOS to android.
        
         | ChuckNorris89 wrote:
         | That's the neat part about this. Need a Linuxy ARM SBC to run
         | python, or a tiny web server, or home automation hub or
         | something like that but Raspberry PIs are unavailable or
         | overpriced in your area and alternative products are too
         | sketchy and unsupported? No problemo.
         | 
         | Just get an old Android flagship off the second hand market
         | that can be had dirt cheap, flash some FOSS de-Googled ROM on
         | it, and use that instead. You now have the power of Linux and
         | Android ecosystems for much less than a Pi and it comes with a
         | display and battery! Need GPIO too? You can connect an external
         | GPIO board via USB-OTG to the phone and control that via Python
         | just like with a Raspberry PI.
        
           | jeroenhd wrote:
           | For extra tricks (and challenges), buy an Android phone that
           | can run postmarketOS, which is basically Alpine Linux. This
           | comes with more up to date kernels (something older phones
           | often lack) and can run things like Docker without too much
           | trouble.
           | 
           | Most phones aren't fully supported but there are a bunch of
           | phones with decent support and modern enough SoCs that can be
           | had for cheap.
           | 
           | PmOS devices don't run Android so the Android HAL that custom
           | ROMs often rely on isn't in use, which can lead to broken
           | hardware support. On the other hand, many of these devices
           | run a recent version of Linux so you can play around with all
           | kinds of modern features.
           | 
           | https://wiki.postmarketos.org/wiki/Devices
        
           | freedomben wrote:
           | Wow what a great idea. I currently use my Raspberry Pi to
           | make OCI container build for ARM, but for some reason docker
           | routinely breaks on raspbian. The most recent aggravating
           | breakage is that the system clock always goes to Jan 1 1970
           | inside the container, and I can't figure out why (if anyone
           | knows how to fix this, I'd be eternally grateful for a hint).
           | Because of this I've scripted an ARM EC2 instance that spins
           | up, builds the image, pushes it, and spins down, but I'd love
           | to have a local solution on hardware I own. I'm gonna give
           | this a try!
        
           | eggy wrote:
           | So true. I use Termux, but I haven't used an Android phone to
           | replace my embedded stuff. I have used tablets as interfaces
           | to some of my projects. I have an old Keyone Blackberry I
           | should try this with. The real keyboard may come in handy if
           | the screen is acting up. Any recommendations for a FOSS de-
           | Googled ROM? I've tried this in the past, but I have not kept
           | up with them.
           | 
           | My needs sometimes call for more realtime control, and the
           | system I ran in the past (Navigator) ran on QNX (owned by
           | Blackberry) a microkernel OS (like Minix was, not Linux). Is
           | there a close competitor in the Android world?
        
           | bahmboo wrote:
           | Used flagships have always worked well for me. They were
           | built the best at the time whereas new budget phones have to
           | cut corners. Phone tech is not changing that fast anymore.
        
             | freedomben wrote:
             | How old/used is the price sweet spot? Have you gotten
             | bad/broken devices? Where do you buy them to avoid people
             | over-representing the status of the device?
             | 
             | I've got kids that are starting to need phones and this
             | seems like a great way to do it.
        
       | newswasboring wrote:
       | Termux is one of my favorite mobile app. Especially because I can
       | run basically whatever I want to it as long as it's in text mode.
       | X11 support is there but honestly that too janky for me and I'm
       | more comfortable with cli any ways. There are some bonkers things
       | we can do with this. Like running dwarf fortress on it[1]. My
       | favorite thing is running Julia+Pluto so I can do stupid toys on
       | it.
       | 
       | I sometimes wonder what kind of stress I'm putting on my phone by
       | doing this.
       | 
       | [1]
       | https://www.reddit.com/r/dwarffortress/comments/r80m7y/dwarf...
        
       | sleepycatgirl wrote:
       | It is real comfy on e-ink android devices :3
        
       | neals wrote:
       | One of those things. It's on my phone for years, never used it,
       | had to use it today. Now it's top on HN. Anyway. The reason I
       | never use it dawned on me. I can't install an ssh client and I
       | don't get their package manager for some reason.
        
         | haunter wrote:
         | >I can't install an ssh client
         | 
         | You can instal OpenSSH
         | https://wiki.termux.com/wiki/Remote_Access
         | 
         | >I don't get their package manager for some reason
         | 
         | It's the same as Ubuntu/Debian
        
       | devmunchies wrote:
       | I don't use android, but why not just install a custom android
       | ROM (with root privileges)? Is it a hardware driver issue? Is it
       | too much work to keep an android distribution up to date?
       | ...like, does Samsung do any work to make sure it's difficult to
       | use anything other than their pre-installed android?
        
         | knaik94 wrote:
         | Not all phones allow you to root, even if you paid outright for
         | the device. Termux is different from a custom ROM, Termux gives
         | you things like native nodejs, python, ffmpeg, git, and nmap.
         | It's independent from the underlying OS. All phone come with a
         | bootloader lock and only some companies allow you to unlock it.
         | You need to do a bootloader and oem unlock in order to have the
         | ability to root. Certain devices have sensors/parts that aren't
         | supported via AOSP, back in the day I remember reading "not
         | working: wifi" in the feature list for custom roms. I think
         | wifi is usually okay now, but camera and cellular modem are
         | still not guaranteed.
        
       | tester457 wrote:
       | One of the reasons I like chatgpt is that it makes coding on
       | phone much more accessible. Type a prompt and paste it into vim
       | in termux.
       | 
       | Using scripts to edit and maintain your android internal file
       | system is another plus. Unfortunately can't write to SD card if
       | you're not rooted.
        
       ___________________________________________________________________
       (page generated 2023-04-29 23:00 UTC)