4 ms·
I feel like I'm a bit out of the loop here, getting a local shell on an iOS device was one of the immediate benefits from Jailbreaking. It was even a native iOS
by notaplumber 8y ago
I feel like I'm a bit out of the loop here, getting a local shell on an iOS device was one of the immediate benefits from Jailbreaking. It was even a native iOS binary, usually bash or Korn Sell, along with sshd. No need for such an elaborate Linux ABI transposing layer, as the iOS kernel supported enough Unix to run this stuff fine. But even if the iOS SDK/libc has since dropped certain functions or POSIX headers, the kernel undoubtedly still supports it.
If this software could be developed and installed, cross-compiling a native Unix toolchain, either from the open source code distributed by Apple, or the BSDs, or even GNU, should be just as easy to pull off.
So what gives?
- JonathonW 8y agoThe tricky part with an unjailbroken device (for third-party developers) is that apps can’t fork/exec, or any of the equivalents— aside from a couple exceptions around app extensions, the binary that gets run when the user taps the app on the home screen is the only one that ever can be run. That’s fine for most GUI-driven applications, but it’s kind of problematic for a traditional *nix-style shell. If you were Apple, or you had a jailbroken device and could circumvent the sandbox, you wouldn’t have any problems running a normal shell and command line utilities.
- notaplumber 8y agoThat's interesting, indeed-- it is unfortunate that developers have no ability to circumvent these restrictions even for local development. It makes owning such a device even more baffling, sounds incredibly useless to me. I didn't know iOS was such a trash fire.
- umanwizard 8y agoReally, you can't understand why anyone would buy a device that you can't easily run a shell on? Can you run bash on your dishwasher?
- notaplumber 8y agoI hand wash my dishes. But yes-- I certainly do expect to be able to run a shell on any computer that I own. It's nice to hear that iOS devices are just another appliance for the affluent majority.
- jsjohnst 8y agoTerrible example as most dishwashers don’t run a Unix-like operating system. Spin that example to something running an embedded Linux OS (like my Samsung TV) and the answer is yes (but not in a factory supported way).
- saagarjha 8y ago> aside from a couple exceptions around app extensions Which Apple has cleverly made sure are not under the control of your process. There really is no way to reliably spawn another process and get it to communicate back to your application. > If you were Apple, or you had a jailbroken device and could circumvent the sandbox, you wouldn’t have any problems running a normal shell and command line utilities. Apple does in fact have the ability to spawn a shell on internal devices.
- saagarjha 8y ago> But even if the iOS SDK/libc has since dropped certain functions or POSIX headers, the kernel undoubtedly still supports it. Fun fact: the kernel has continuously been dropping features that are seen as “unnecessary” on iOS. For example, I recently heard that iOS no longer supports setuid at all; the entire feature has been ripped out of the kernel because it’s not used.