10

I would like an equivalent to Termux on iOS. It should in some way emulate a Linux command line with a full range of installable packages like apt and ideally even run Linux (as with Andronix), and be about as fast as the phone’s hardware normally allows.

There is iSH but for some reason I find it quite slow, I don’t know if it’s built in some fundamentally different way than Termux.

Is there a good option for this (willing to jailbreak if necessary)?

7
  • Questions about "why" things exist/don't exist are hard to answer and often based on opinions, I've edited your question to focus on the actual problem. Have you already looked into options available after a jailbreak?
    – nohillside
    Commented Oct 11, 2021 at 6:03
  • Thank you. No, I’ll turn to jailbreaking next. I’m interested to know why iSH seems less developed than Termux, are there more constraints in iOS development than on Android? Commented Oct 11, 2021 at 16:27
  • 1
    Termux is actually runs ARM binaries, and it exposes android's built-in features desending from Linux to user. iSH is userspace x86-64 emulation, kinda like a mini VM According to the developer using ARM doesn't make much improvement and makes less software readily available. Commented Oct 11, 2021 at 18:21
  • Thanks. I don’t understand the last sentence though - why wouldn’t using the CPU binaries be faster than emulation and would make software less available? Commented Oct 11, 2021 at 23:12
  • For emulation question read the FAQ linked above, and about availabality, emulation allows using x86 binaries, one that runs on typical desktops and laptops. There will be much more works to do to port them to ARM, not all may be even portable and developer need to maintain the repo and compile packages whenever a release comes out. Commented Oct 12, 2021 at 4:28

2 Answers 2

9

To answer the question "why" (is there no equivalent to termux on iOS): iOS places more restrictions on binaries that can be executed or loaded. It's not enough to cross-compile, the binaries also need to be signed with the developer certificate and placed in a directory that can only be accessed when the app is written on the phone. So you just cannot add new executables to an existing app on a non-jailbroken iPhone.

iSH works around this limitation by loading x86 binaries, that are executed using their x86 emulator. The good part is that anything can be installed, the not-so-good part is that the emulator can be slow.

a-Shell (and before it OpenTerm, and also Libterm) work around this limitation by having all the commands written when the app is installed on the phone. So you have a lot of commands, and they're fast, but you cannot add more commands (full disclosure: I'm the author of a-Shell, and contributed a lot to OpenTerm).

2
  • I assume that even a-Shell is restricted to its sandbox and access to the full filesystem is prohibited?
    – nohillside
    Commented Oct 17, 2021 at 13:53
  • 1
    Since iOS 11, the answer is more subtle than that. The short answer is still yes. The long answer: the user can grant access to the sandbox of all the apps that allow it, but it has to be explicit: by clicking on a directory, you grant access. So a-Shell (and OpenTerm, LibTerm, iVim...) can edit or create files in other apps sandbox. The rest of the filesystem is mostly prohibited, with some weird quirks: / is allowed, /System is forbidden, /System/Library is allowed. Commented Oct 17, 2021 at 13:55
6

Yes, there are

  • LibTerm available under MIT on GitHub
  • a-shell available under 3-Clause BSD on GitHub (these two don't differ from iSH much behind the scene, I guess but you can see some difference)

If you jailbreak there are lot other option like MTerminal, NewTerm etc.

And lastly, projects are underway to port Linux on iPhone, see Project Sandcastle. PMOS (their wiki) and Ubuntu are known to boot on iPhone 7.

2
  • Maybe jail breaking or Sandcastle for sure, but I’m a little surprised in that Android has such a developed tool, Termux, and iOS just doesn’t seem to have any truly native solution. The only convenient way I can think of for getting a good terminal might be sshing into Digital Ocean or a Raspberry Pi. Commented Oct 11, 2021 at 23:17
  • 1
    Ask Apple the reason why. HBS paper on closeness of platform with pretty table in WP. Commented Oct 12, 2021 at 5:40

You must log in to answer this question.

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