On iOS the termux equivalent is iSH and a-shell. Both of these are, somehow, Apple-approved, free downloads from the App Store, and generally work well[0]. But they all have had to fight Apple on Section 2.5.2, which is kind of similar to whatever was tripping up termux on Google Play.

Ostensibly, 2.5.2 should mean "do not hide things from App Review by loading unreviewed code", which is entirely reasonable and defensible. But in practice, App Review likes to interpret it as "do not allow the user to load unreviewed code onto their device" - which neatly prohibits all emulation and virtualization apps. iSH was banned for a time because of this exact provision - it's an x86 userland emulator with an API-compatible Linux kernel shim, much like that weird Java MIPS emulator[1] a lot of old CS courses taught assembly and OS dev in. The reason why iSH is back up is because App Review changed their mind, for reasons I don't quite understand.

There are on-device code interpreters for scripting languages in the App Store too - 2.5.2 has a separate, explicit carveout for them that Apple made very clear in the iDOS 2 rejection does not apply to emulators. In fact, that rejection letter pretty much spells out in plain language that Apple thinks emulators are piracy tools. They rejected UTM's TestFlight submissions on a similar basis, albeit with less righteous indignation and more silence.

I think the biggest problem here is the "you're holding it wrong" factor, though. Apple didn't notice iDOS 2 until media outlets were telling people how to install Windows 3.1 onto it. One of Apple's big no-nos is "do not give the user a windowing interface", because the core philosophy of iOS is that touch inputs need dedicated software with different code from mouse input[2]. Likewise, Apple doesn't think coding on an iPad is a good idea. That 2.5.2 carveout I mentioned before patronizingly calls those script interpreters "learn-to-code apps", with the idea that these are educational tools and that developers are expected to graduate to a Mac in order to get real work done.

Google likes to blindly copy what Apple does sometimes, without understanding why and what tradeoffs Apple is making. In the case of termux, Android used to be way less strict about loading code and let apps load binaries straight from user data; but they decided to enforce the same restrictions Apple does, which broke the app if they updated it for Android 10. The underlying problem is, again, "you're holding it wrong" - the people who work on security for these devices at both Apple and Google do not consider development workflows and do not want to have to do so. It's much easier to keep malware off a device if you just put your foot down and say "no programming on-device".

[0] I can't get Rust to run on iSH, and a-shell would require patching it into `ios-system` or retargeting rustc to run in WASI hosts.

[1] MARS, I think it was called?

[2] This is literally the reason why the iPad was even created. Back in the days of Windows XP, one of Steve Jobs' friends was bugging him about how XP tablets were going to storm the market. Jobs had Apple make a tablet computer demo that only accepted finger input, and this demo later became the iPhone's touch input mechanism. The entirety of what we awkwardly call "mobile devices" today exists purely out of spite.

Yes, I know Catalyst muddies the waters on this, and the Magic Keyboard breaks this ideology in half. I'm literally typing on a Magic Keyboard right now and it absolutely does make the iPad the most confused device I've ever used.