Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift
1004 B
Raw Blame
import Foundation

enum VPhoneVirtualMachineError: Error, CustomStringConvertible {
    case hardwareModelNotSupported
    case romNotFound(String)
    case diskNotFound(String)
    case invalidKernelDebugPort(Int)
    case apiSocketUnavailable

    var description: String {
        switch self {
        case .hardwareModelNotSupported:
            """
            PV=3 hardware model not supported. Check:
              1. macOS >= 15.0 (Sequoia)
              2. Signed with com.apple.private.virtualization + \
            com.apple.private.virtualization.security-research
              3. SIP/AMFI disabled
            """
        case let .romNotFound(p):
            "ROM not found: \(p)"
        case let .diskNotFound(p):
            "Disk image not found: \(p)"
        case let .invalidKernelDebugPort(port):
            "Invalid kernel debug port: \(port) (expected 6000...65535)"
        case .apiSocketUnavailable:
            "VM has no VSOCK device for the API proxy"
        }
    }
}