# Command line

Every command the tinyphone command line tool runs, what each reads or changes on the phone, its flags and its exit codes.

The Mac app's engine in a terminal. JSON out, `--text` for people.

## Install

In Tinyphone for Mac, Settings, Install Command Line Tool links `tinyphone` into `/usr/local/bin`. Remove Command Line Tool takes it out again. The tool works on the phone on this Mac's cable.

## Reading

| command | what it gives |
| --- | --- |
| `tinyphone phones` | the phones on the cable: iOS, supervised, ours or not |
| `tinyphone inspect` | every profile, app and property the phone carries |
| `tinyphone modes` | the phone's saved modes, the active one starred |
| `tinyphone history` | what this Mac did to the phone, newest first |
| `tinyphone profiles list` | the phone's own profile list |
| `tinyphone backups` | the backups on this Mac |
| `tinyphone doctor` | Apple Configurator present, this Mac's identity, the phone paired |

## Changing the phone

| command | what it does |
| --- | --- |
| `tinyphone apply --preset kid` | a mode onto the phone, then the phone read back; `kid`, `easy`, `focus` or `dumbphone` |
| `tinyphone apply --mode mode.json` | your own mode, as the JSON the Mac app saves |
| `tinyphone profiles remove <id>` | one profile off the phone |
| `tinyphone profiles sweep` | every profile of ours off the phone |
| `tinyphone backup` | the phone backed up into this Mac's MobileSync folder |
| `tinyphone restore` | the phone's own backup back onto it; `--source <udid>` for another |
| `tinyphone fresh --preset kid` | erase and set the phone up again; asks you to type the phone's name, `--yes` skips it |

## Flags

| flag | for |
| --- | --- |
| `--ecid <ecid>` | which phone, when more than one is on the cable (`tinyphone phones` lists them) |
| `--text` | lines for people instead of JSON |
| `--setup` | apply the mode as setup leaves it: the App Store and Safari kept, so the apps that stay can be installed |

## Exit codes

| code | means |
| --- | --- |
| `0` | done |
| `1` | failed |
| `2` | the phone is locked: unlock it and run again |
| `3` | this Mac's supervision identity was refused |
| `4` | Apple Configurator's cfgutil is missing |
| `5` | no phone on the cable |
| `6` | bad arguments |

Source: https://tinyphone.app/docs/cli