[Info-vax] somewhat off-topic: command line on iOS
John Dallman
jgd at cix.co.uk
Sun Jan 3 16:31:00 EST 2021
In article <rst8sd$17rc$1 at gioia.aioe.org>,
helbig at asclothestro.multivax.de (Phillip Helbig (undress to reply))
wrote:
> I spent some time trying to find something, but to no avail. There
> are tools designed for accessing other systems, but what I want is
> a prompt on the iPad. (I don't have to access all the directories,
> just stuff where I save files and/or it would be nice to be able to
> specify a location I can access.) There are various command-line
> interfaces, but they execute more or less standalone commands,
> rather than interacting with files on the system.
The iPad OS is deliberately designed to NOT be a general-purpose computer,
and there are enforcement mechanisms for that. In particular, the
"software tools" approach was rejected at the start of designing the OS,
and has not been allowed back in.
Apple are not, in their thinking, a computer company. They're much more
like a fashion house, whose products happen to be electronics, software,
and digital media, rather than clothing, accessories and jewelry. Their
model of a customer is of someone who's motivated by fashion and status,
rather than someone who wants to do technical work of any kind. Because
these people have money, or they would not be buying Apple products,
there are many iPad software products that press up against the limits of
the OS, but those limits cannot be exceeded without jailbreaking.
In this group, I can readily explain how those limits work. The key
feature is that an iPad should /never/ require any kind of system
administration. A key feature of this is that apps cannot interact with
each other. Each app is given two directory trees, whose (long) names are
determined randomly at installation. One contains its executables and
application-provided data, and the other is used to hold user-created
data, temporary files, and so on. The application cannot access any other
directory trees on the device; it doesn't have permissions to do so, and
has no way to acquire any kind of super-user privileges that would allow
it to bypass those restrictions.
The underlying operating system is UNIX-like, but does not have a "shell"
or other command-line interface. It isn't just hidden, it really isn't
there. One of the first things that's normally done on a jailbroken
device is to install a command-line interpreter and a set of utility
programs for it. However, jailbreaking requires discovering a usable
security vulnerability in iPadOS, and Apple try hard to close those off.
The OS does provide some facilities for transferring data between apps
and the OS, which can be used in a multi-hop approach to move data
between apps. However, this only works for movies, music and photographs,
and only if they're in the right formats. You could hide other kinds of
data in those files, but at this point it's obvious that you're using the
wrong tools.
It would be possible to offer a command line interpreter embedded in an
iPadOS app, along with utilities. However, it would not be much use,
since it would only be able to deal with the files in its own directory
tree, and could not see files downloaded by a web browser. Also, if this
was offered, Apple would probably refuse to distribute it.
I went through all this a few years ago when I needed to port a software
test harness that runs as a command-line app to the iPad. It was a
painful experience.
John
More information about the Info-vax
mailing list