IOS – Do terminal TTYs for iOS and macOS exist

darwiniosmacosterminalunix

Seeing that multiple TTYs exist on FreeBSD and Darwin, and they provide the core of macOS and iOS, how would I access such TTYs? And would they be multiple instances of GUIs or would they involve terminals? I would very much prefer for there to be an environment similar to FreeBSD for testing purposes.

Please enlighten me as to whether or not such environments exist (or can exist) on Apple's OSes. I am interested in whether or not I can create one as a proof-of-concept, whether it can be on iOS 13 beta, iOS 5, macOS Mojave, or macOS Snow Leopard.

Best Answer

TTYs exist and operate in Mac OS X and macOS just as they do in any other UNIX or UNIX-like operating system. When macOS boots, the TTY that inits to subsequently load the GUI is always console. Subsequent TTYs opened from Terminal.app or other emulators are listed from ttys000 and the digits increment one at a time.

You can open Terminal and check your TTY as in the examples below:

$ tty
/dev/ttys000

Or

$ who
trane    console  Sep  1 05:18 
trane    ttys000  Sep  1 05:19 
trane    ttys001  Sep  1 05:19

Or

$ w
13:04  up 1 day,  7:46, 3 users, load averages: 1.85 2.02 3.87
USER     TTY      FROM              LOGIN@  IDLE WHAT
trane    console  -                Sun05   31:45 -
trane    s000     -                Sun05       - w
trane    s001     -                Sun05       9 -bash

For more information on those commands, see the relevant man pages. For e.g., type man who and quit using q.

It's worth noting that macOS only runs one instance of the Aqua GUI for a particular display device.