Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Remove the UI Inspector

Lakr627497b27fbf
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
index 0f54258b..a17ab50b 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControl.swift
@@ -250,7 +250,6 @@ final class VPhoneGuestControl {
case "settings_get": method = "settings.get"
case "settings_set": method = "settings.set"
case "low_power_mode": method = "power.low_power_mode"
- case "accessibility_tree": method = "accessibility.tree"
default: throw ControlError.protocolError("unknown operation \(type)")
}
var params = request
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControlSystem.swift b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControlSystem.swift
index 7a8d6159..cd59d1cf 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControlSystem.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/GuestCommunication/VPhoneGuestControlSystem.swift
@@ -38,14 +38,4 @@ extension VPhoneGuestControl {
throw ControlError.guestError("low_power_mode: failed to set state on guest")
}
}
-
- // MARK: - Accessibility
-
- func accessibilityTree(depth: Int = -1) async throws -> [String: Any] {
- guard guestCapabilities.contains("ui_inspection") else {
- throw ControlError.unsupportedCapability("ui_inspection")
- }
- let (resp, _) = try await sendRequest(["t": "accessibility_tree", "depth": depth])
- return resp
- }
}
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuDiagnostics.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuDiagnostics.swift
index 4646a66c..f3415ecc 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuDiagnostics.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Menu/VPhoneMenuDiagnostics.swift
@@ -17,8 +17,6 @@ extension VPhoneMenuController {
menu.addItem(makePanelItem(.console, "Console", keyEquivalent: "l", symbol: "terminal"))
menu.addItem(makePanelItem(.crashLogs, "Crash Logs", keyEquivalent: "c", symbol: "exclamationmark.triangle"))
menu.addItem(NSMenuItem.separator())
- menu.addItem(makePanelItem(.uiInspector, "UI Inspector", keyEquivalent: "u", symbol: "rectangle.dashed"))
- menu.addItem(NSMenuItem.separator())
let devModeStatus = makeItem(
"Developer Mode Status",
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/VPhoneGuestPanelsWindowController.swift b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/VPhoneGuestPanelsWindowController.swift
index 7f5c935e..171eb218 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/VPhoneGuestPanelsWindowController.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/UserInterface/Panels/VPhoneGuestPanelsWindowController.swift
@@ -11,7 +11,6 @@ enum VPhoneGuestPanel: CaseIterable {
case console
case crashLogs
case services
- case uiInspector
case controls
/// The `/v1/health` capability an agent must report before the panel can
@@ -22,7 +21,6 @@ enum VPhoneGuestPanel: CaseIterable {
case .processes: "processes"
case .console, .crashLogs: "logs"
case .services: "services"
- case .uiInspector: "ui_inspection"
case .controls: "display"
}
}
@@ -90,14 +88,6 @@ final class VPhoneGuestPanelsWindowController {
size: NSSize(width: 1000, height: 680),
minSize: NSSize(width: 760, height: 480),
) { VPhoneServicesView(model: model) }
- case .uiInspector:
- let model = VPhoneUIInspectorModel(control: control)
- return VPhoneGuestToolWindow(
- title: String(localized: "UI Inspector", bundle: VPhoneLocalization.bundle),
- autosaveName: "vphone-panel-ui-inspector",
- size: NSSize(width: 1080, height: 720),
- minSize: NSSize(width: 840, height: 540),
- ) { VPhoneUIInspectorView(model: model) }
case .controls:
let model = VPhoneControlsModel(control: control)
return VPhoneGuestToolWindow(