Run a virtual iPhone on an Apple Silicon Mac.
Swift
Create many machines
vm create-bulk creates every machine a plist describes, in order. Use it to set up a lab or CI fleet from one file.
Run it
vphone-cli vm create-bulk list.plist --dry-run # print each machine's vm create command
vphone-cli vm create-bulk list.plist
Run it with sudo when a machine needs a build, as with vm create.
Write the list
<dict>
<key>version</key> <integer>1</integer>
<key>defaults</key>
<dict>
<key>library-root</key> <string>~/vphone-lab</string>
<key>iphone-version</key> <string>26.1</string>
<key>preset</key> <string>presets/lab.plist</string>
<key>cpu</key> <integer>4</integer>
</dict>
<key>machines</key>
<array>
<dict><key>name</key> <string>ci-1</string></dict>
<dict><key>name</key> <string>ci-2</string></dict>
<dict>
<key>name</key> <string>fuzz</string>
<key>iphone-build</key> <string>23F77</string>
<key>iphone-version</key> <false/>
<key>no-template</key> <true/>
</dict>
</array>
</dict>
- Each key is a
vm createoption's long name, with its value: a string or integer,truefor a flag, an array forkeep-apps. defaultsapply to every machine. A machine's own keys win, andfalseclears a default.- Relative paths resolve against the plist's folder.
library-rootputs the machines in another library;-lon the command line overrides it.- Every machine must name its firmware (
iphone-version,iphone-build, oriphone-sourcewithcloudos-source) or atemplate, so nothing prompts.
How the run behaves
All machines are checked as vm create checks them before the first is made. Machines are created in order, so those with one template key clone the template the first one built. The first failure stops the run.
A name that already exists is an error. Two flags change that; they cannot be combined:
| Flag | Effect |
|---|---|
--skip-existing |
Skips a machine whose name exists, so a run that stopped can be run again for the rest. A machine that failed is left as it stopped, so delete it first or it is skipped too. |
--force-override |
Deletes that VM just before its machine is created. Refuses one that is running, or a folder that is not a VM. |