Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

Open Launchpad populated, add a menu bar mode, detach VMs

Lakr6615c8bcbcff
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneDockName.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneDockName.swift
new file mode 100644
index 00000000..4eecd89f
--- /dev/null
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneDockName.swift
@@ -0,0 +1,39 @@
+import AppKit
+import Foundation
+
+/// Names this process after the VM in the Dock, the app switcher and Force
+/// Quit, instead of "VPhone.bundle" for every guest.
+///
+/// Launch Services keeps the display name per running application and only
+/// exposes the setter privately; it is looked up at run time, and a missing
+/// symbol leaves the bundle name in place.
+enum VPhoneDockName {
+ private typealias CurrentASN = @convention(c) () -> Unmanaged<CFTypeRef>?
+ private typealias SetInformationItem = @convention(c) (
+ Int32, CFTypeRef, CFString, CFTypeRef, UnsafeMutablePointer<Unmanaged<CFDictionary>?>?,
+ ) -> OSStatus
+
+ /// `kLSDefaultSessionID`.
+ private static let defaultSession: Int32 = -2
+
+ /// Call after the application has checked in with Launch Services, that
+ /// is from `applicationDidFinishLaunching` on.
+ @MainActor
+ static func set(_ name: String) {
+ guard !name.isEmpty,
+ let handle = dlopen(nil, RTLD_NOW),
+ let currentASN = dlsym(handle, "_LSGetCurrentApplicationASN"),
+ let setItem = dlsym(handle, "_LSSetApplicationInformationItem"),
+ let displayNameKey = dlsym(handle, "_kLSDisplayNameKey")
+ else { return }
+ let asn = unsafeBitCast(currentASN, to: CurrentASN.self)()?.takeUnretainedValue()
+ guard let asn else { return }
+ let key = displayNameKey.assumingMemoryBound(to: CFString.self).pointee
+ _ = unsafeBitCast(setItem, to: SetInformationItem.self)(defaultSession, asn, key, name as CFString, nil)
+ }
+
+ /// The VM's name is its folder in the library, the one holding config.plist.
+ static func name(forConfig config: URL) -> String {
+ config.deletingLastPathComponent().lastPathComponent
+ }
+}
diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
index 2cb17e0c..f54e1ea2 100644
--- a/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VPhoneVirtualMachineAppDelegate.swift
@@ -26,6 +26,7 @@ class VPhoneVirtualMachineAppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_: Notification) {
NSApp.setActivationPolicy(command.noGraphics ? .prohibited : .regular)
+ VPhoneDockName.set(VPhoneDockName.name(forConfig: command.config))
signal(SIGINT, SIG_IGN)
let src = DispatchSource.makeSignalSource(signal: SIGINT, queue: .main)
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadApp.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadApp.swift
index f0ec8582..024e36fa 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadApp.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadApp.swift
@@ -5,6 +5,7 @@ import SwiftUI
struct VPhoneLaunchpadApp: App {
@NSApplicationDelegateAdaptor(VPhoneLaunchpadAppDelegate.self) private var delegate
@State private var model = VPhoneLaunchpadModel()
+ @AppStorage(VPhoneLaunchpadMenuBar.key) private var showsInMenuBar = false
var body: some Scene {
Window(Text(verbatim: "vphone-launchpad"), id: "main") {
@@ -20,6 +21,17 @@ struct VPhoneLaunchpadApp: App {
Button("Core Bundle…") { model.panel = .coreBundle }
}
}
+
+ MenuBarExtra(isInserted: $showsInMenuBar) {
+ VPhoneLaunchpadMenuBarMenu()
+ .environment(model)
+ } label: {
+ Label {
+ Text(verbatim: "vphone-launchpad")
+ } icon: {
+ Image(systemName: "iphone")
+ }
+ }
}
}
@@ -29,9 +41,15 @@ struct VPhoneLaunchpadApp: App {
@MainActor
final class VPhoneLaunchpadAppDelegate: NSObject, NSApplicationDelegate {
weak var model: VPhoneLaunchpadModel?
+ private let dockPolicy = VPhoneLaunchpadDockPolicy()
+
+ func applicationDidFinishLaunching(_: Notification) {
+ dockPolicy.start()
+ }
+ /// In menu bar mode the app stays behind in the menu bar.
func applicationShouldTerminateAfterLastWindowClosed(_: NSApplication) -> Bool {
- true
+ !VPhoneLaunchpadMenuBar.isEnabled
}
func applicationShouldTerminate(_: NSApplication) -> NSApplication.TerminateReply {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadFilePanel.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadFilePanel.swift
new file mode 100644
index 00000000..63a1a753
--- /dev/null
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadFilePanel.swift
@@ -0,0 +1,20 @@
+import AppKit
+
+extension NSSavePanel {
+ /// Shows the panel as a sheet on the front window, which is the form
+ /// sheet itself when one is open, and calls `choose` with the pick.
+ /// Without a window it falls back to a modal panel.
+ func present(_ choose: @escaping @MainActor (URL) -> Void) {
+ guard let window = NSApp.keyWindow ?? NSApp.mainWindow else {
+ if runModal() == .OK, let url {
+ choose(url)
+ }
+ return
+ }
+ beginSheetModal(for: window) { [self] response in
+ if response == .OK, let url {
+ MainActor.assumeIsolated { choose(url) }
+ }
+ }
+ }
+}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadMenuBar.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadMenuBar.swift
new file mode 100644
index 00000000..f252f840
--- /dev/null
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadMenuBar.swift
@@ -0,0 +1,106 @@
+import AppKit
+import SwiftUI
+
+// MARK: - Setting
+
+/// Menu bar mode: closing the window keeps Launchpad running in the menu bar,
+/// and the Dock icon follows what is on screen.
+enum VPhoneLaunchpadMenuBar {
+ static let key = "VPhoneLaunchpadShowsInMenuBar"
+
+ static var isEnabled: Bool {
+ UserDefaults.standard.bool(forKey: key)
+ }
+}
+
+// MARK: - Menu
+
+struct VPhoneLaunchpadMenuBarMenu: View {
+ @Environment(VPhoneLaunchpadModel.self) private var model
+ @Environment(\.openWindow) private var openWindow
+
+ var body: some View {
+ Button("Open Launchpad") {
+ NSApp.setActivationPolicy(.regular)
+ openWindow(id: "main")
+ NSApp.activate()
+ }
+ Divider()
+ if model.machines.machines.isEmpty {
+ Text("No Machines")
+ }
+ ForEach(model.machines.machines) { machine in
+ let state = model.machines.state(of: machine.path)
+ Menu {
+ switch state {
+ case .running:
+ Button("Stop") {
+ Task { await model.machines.stop(machine.path) }
+ }
+ case .stopped:
+ Button("Start") { model.machines.start(machine.path) }
+ Button("Start Headless") { model.machines.start(machine.path, headless: true) }
+ case let .busy(activity):
+ Text(activity)
+ }
+ } label: {
+ Label(machine.name, systemImage: state == .running ? "circle.fill" : "circle")
+ }
+ }
+ Divider()
+ Button("Quit") {
+ NSApp.terminate(nil)
+ }
+ .keyboardShortcut("q")
+ }
+}
+
+// MARK: - Dock icon
+
+/// Shows the Dock icon while a window, minimized or not, or a menu is open,
+/// and hides it otherwise. Checked once a second, in every run loop mode so
+/// it also runs while a menu is tracking.
+@MainActor
+final class VPhoneLaunchpadDockPolicy {
+ private var timer: Timer?
+ private var menusOpen = 0
+
+ func start() {
+ let center = NotificationCenter.default
+ center.addObserver(forName: NSMenu.didBeginTrackingNotification, object: nil, queue: .main) { [weak self] _ in
+ MainActor.assumeIsolated {
+ self?.menusOpen += 1
+ self?.update()
+ }
+ }
+ center.addObserver(forName: NSMenu.didEndTrackingNotification, object: nil, queue: .main) { [weak self] _ in
+ MainActor.assumeIsolated {
+ guard let self else { return }
+ self.menusOpen = max(0, self.menusOpen - 1)
+ }
+ }
+ let timer = Timer(timeInterval: 1, repeats: true) { [weak self] _ in
+ MainActor.assumeIsolated { self?.update() }
+ }
+ RunLoop.main.add(timer, forMode: .common)
+ self.timer = timer
+ }
+
+ private func update() {
+ guard VPhoneLaunchpadMenuBar.isEnabled else {
+ setPolicy(.regular)
+ return
+ }
+ // Titled windows only: the status item and open menus are windows too.
+ let hasWindow = NSApp.windows.contains { window in
+ window.styleMask.contains(.titled) && (window.isVisible || window.isMiniaturized)
+ }
+ setPolicy(hasWindow || menusOpen > 0 ? .regular : .accessory)
+ }
+
+ private func setPolicy(_ policy: NSApplication.ActivationPolicy) {
+ if NSApp.activationPolicy() != policy {
+ NSApp.setActivationPolicy(policy)
+ }
+ }
+}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadModel.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadModel.swift
index 21f0d7c0..5d7f2eb2 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadModel.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Application/VPhoneLaunchpadModel.swift
@@ -73,18 +73,26 @@ final class VPhoneLaunchpadModel {
return
}
#endif
- await host.refresh()
+ // Host checks, installed bundles and the helper state were read at
+ // init. These confirm them without holding up the machine list; the
+ // network probe and the GitHub lists come last.
+ machines.startMonitoring()
+ async let listed: Void = machines.refresh()
+ async let hostChecked: Void = host.refresh()
+ await bundles.checkActive()
+ await hostChecked
if case .outdated = helper.state {
await host.installHelper()
await host.refresh()
+ await bundles.checkActive()
}
- await bundles.refresh()
- await machines.refresh()
- machines.startMonitoring()
+ await listed
// An unfinished install is picked up in the inspector instead.
if panel == nil, bundles.progress == nil || bundles.progress?.isFinished == true {
panel = !host.requiredPassed ? .hostSetup : !bundles.isReady ? .coreBundle : nil
}
+ await bundles.fetchReleases()
+ await bundles.fetchArtifacts()
}
func refreshHost() async {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Command/VPhoneLaunchpadChildProcess.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Command/VPhoneLaunchpadChildProcess.swift
index 2803b8dc..d4c4af8b 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Command/VPhoneLaunchpadChildProcess.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Command/VPhoneLaunchpadChildProcess.swift
@@ -10,11 +10,18 @@ import Foundation
/// pipe, quitting the app would close the read end and the next line of
/// guest serial output would kill the VM with SIGPIPE. The file is tailed
/// while the app runs and stays behind as the machine's console log.
+/// The guest is also detached: it gets its own session and is responsible
+/// for itself, so macOS does not keep Launchpad listed as running in the
+/// background, or attribute the guest's privacy prompts to it, after the
+/// app quits.
final nonisolated class VPhoneLaunchpadChildProcess: @unchecked Sendable {
private let process = Process()
+ /// Set instead of `process` for a detached child.
+ private var detachedPID: pid_t?
private let lock = NSLock()
private var exitStatus: Int32?
private var hasExited = false
+ private var exitCode: Int32 = 0
private var waiters: [CheckedContinuation<Int32, Never>] = []
init(
@@ -37,14 +44,21 @@ final nonisolated class VPhoneLaunchpadChildProcess: @unchecked Sendable {
withIntermediateDirectories: true,
)
FileManager.default.createFile(atPath: logFile.path, contents: nil)
- let writer = try FileHandle(forWritingTo: logFile)
- process.standardOutput = writer
- process.standardError = writer
- process.terminationHandler = { [self] _ in
- lock.withLock { hasExited = true }
+ let pid = try Self.spawnDetached(
+ executable: executable,
+ arguments: arguments,
+ currentDirectory: currentDirectory,
+ logFile: logFile,
+ )
+ detachedPID = pid
+ Thread.detachNewThread { [self] in
+ var status: Int32 = 0
+ while waitpid(pid, &status, 0) == -1, errno == EINTR {}
+ lock.withLock {
+ exitCode = Self.exitCode(status)
+ hasExited = true
+ }
}
- try process.run()
- try writer.close()
let reader = try FileHandle(forReadingFrom: logFile)
Thread.detachNewThread { [self] in
tail(reader, onLine)
@@ -83,14 +97,22 @@ final nonisolated class VPhoneLaunchpadChildProcess: @unchecked Sendable {
/// SIGINT, which `vphone-cli` treats as a graceful stop.
func interrupt() {
- if process.isRunning {
- process.interrupt()
- }
+ signal(SIGINT)
}
func terminate() {
- if process.isRunning {
- process.terminate()
+ signal(SIGTERM)
+ }
+
+ private func signal(_ signal: Int32) {
+ if let detachedPID {
+ // Until waitpid reaps it the PID cannot be reused, so this only
+ // ever reaches our own child.
+ if lock.withLock({ !hasExited }) {
+ kill(detachedPID, signal)
+ }
+ } else if process.isRunning {
+ kill(process.processIdentifier, signal)
}
}
@@ -108,7 +130,61 @@ final nonisolated class VPhoneLaunchpadChildProcess: @unchecked Sendable {
}
splitter.flush(onLine)
try? reader.close()
- finish(process.terminationStatus)
+ finish(lock.withLock { exitCode })
+ }
+
+ // MARK: - Detached spawn
+
+ private typealias SetDisclaim = @convention(c) (UnsafeMutablePointer<posix_spawnattr_t?>, Int32) -> Int32
+
+ /// Starts `executable` in a new session, responsible for itself, with
+ /// stdin on /dev/null and stdout and stderr appended to `logFile`. No other
+ /// descriptor of Launchpad's is inherited.
+ private static func spawnDetached(
+ executable: URL,
+ arguments: [String],
+ currentDirectory: URL?,
+ logFile: URL,
+ ) throws -> pid_t {
+ var attributes: posix_spawnattr_t?
+ posix_spawnattr_init(&attributes)
+ defer { posix_spawnattr_destroy(&attributes) }
+ posix_spawnattr_setflags(&attributes, Int16(POSIX_SPAWN_SETSID | POSIX_SPAWN_CLOEXEC_DEFAULT))
+ // Private libSystem call that Chromium and LLDB use for the same
+ // reason. Without it the child still runs, just attributed to us.
+ if let symbol = dlsym(dlopen(nil, RTLD_NOW), "responsibility_spawnattrs_setdisclaim") {
+ _ = unsafeBitCast(symbol, to: SetDisclaim.self)(&attributes, 1)
+ }
+
+ var actions: posix_spawn_file_actions_t?
+ posix_spawn_file_actions_init(&actions)
+ defer { posix_spawn_file_actions_destroy(&actions) }
+ posix_spawn_file_actions_addopen(&actions, 0, "/dev/null", O_RDONLY, 0)
+ posix_spawn_file_actions_addopen(&actions, 1, logFile.path, O_WRONLY | O_APPEND, 0)
+ posix_spawn_file_actions_adddup2(&actions, 1, 2)
+ if let currentDirectory {
+ if #available(macOS 26, *) {
+ posix_spawn_file_actions_addchdir(&actions, currentDirectory.path)
+ } else {
+ posix_spawn_file_actions_addchdir_np(&actions, currentDirectory.path)
+ }
+ }
+
+ let argv = ([executable.path] + arguments).map { strdup($0) } + [nil]
+ defer { argv.forEach { free($0) } }
+ var pid: pid_t = 0
+ let result = posix_spawn(&pid, executable.path, &actions, &attributes, argv, environ)
+ guard result == 0 else {
+ throw POSIXError(POSIXErrorCode(rawValue: result) ?? .EINVAL)
+ }
+ return pid
+ }
+
+ /// The same number `Process.terminationStatus` reports: the exit code, or
+ /// the signal that ended the process.
+ private static func exitCode(_ status: Int32) -> Int32 {
+ let signal = status & 0x7F
+ return signal == 0 ? (status >> 8) & 0xFF : signal
}
private func finish(_ status: Int32) {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadArtifact.swift b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadArtifact.swift
index 13091bc5..988d2f8f 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadArtifact.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadArtifact.swift
@@ -139,7 +139,7 @@ nonisolated struct VPhoneLaunchpadArtifact: Identifiable, Hashable, Codable, Sen
guard process.terminationStatus == 0,
let name = names.first(where: { $0.range(of: "^VPhone-.+\\.zip$", options: .regularExpression) != nil })
else {
- throw VPhoneLaunchpadError(String(localized: "The artifact does not contain a VPhone bundle zip."))
+ throw VPhoneLaunchpadError(String(localized: "This build does not contain VPhone.bundle. Choose another build."))
}
return directory.appendingPathComponent(name)
}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundle.swift b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundle.swift
index a771ee3c..90cd14c3 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundle.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundle.swift
@@ -45,7 +45,7 @@ final class VPhoneLaunchpadCoreBundle {
case .download: String(localized: "Download")
case .verify: String(localized: "Verify SHA-256")
case .install: String(localized: "Install as root")
- case .policy: String(localized: "Add execution policy exception")
+ case .policy: String(localized: "Allow bundle to run")
case .preflight: String(localized: "Host preflight")
}
}
@@ -149,7 +149,11 @@ final class VPhoneLaunchpadCoreBundle {
private let history: VPhoneLaunchpadCommandHistory
private static let activeVersionKey = "VPhoneLaunchpadActiveBundleVersion"
private static let acceptedVersionsKey = "VPhoneLaunchpadAcceptedBundleVersions"
+ /// Version → receipt SHA-256 of bundles whose last check passed.
+ private static let passedVersionsKey = "VPhoneLaunchpadPassedBundleVersions"
+ /// Lists the store at once, showing each bundle as its last check left
+ /// it, so the window opens ready. The launch check confirms it later.
init(helper: VPhoneLaunchpadHelperClient, history: VPhoneLaunchpadCommandHistory) {
self.helper = helper
self.history = history
@@ -159,6 +163,28 @@ final class VPhoneLaunchpadCoreBundle {
}
#endif
progress = Self.loadProgress()
+ loadInstalled()
+ let passed = UserDefaults.standard.dictionary(forKey: Self.passedVersionsKey) as? [String: String] ?? [:]
+ for index in installed.indices
+ where VPhoneLaunchpadNames.isCompatibleBundleVersion(installed[index].version)
+ && passed[installed[index].version] == installed[index].receipt.sha256
+ {
+ installed[index].policy = .passed
+ installed[index].policyDetail = "exception"
+ installed[index].preflight = .passed
+ installed[index].preflightDetail = String(localized: "Passed")
+ }
+ }
+
+ private func recordCheck(_ version: String) {
+ var passed = UserDefaults.standard.dictionary(forKey: Self.passedVersionsKey) as? [String: String] ?? [:]
+ let item = installed.first { $0.version == version }
+ if let item, item.policy == .passed, item.preflight == .passed {
+ passed[version] = item.receipt.sha256
+ } else {
+ passed[version] = nil
+ }
+ UserDefaults.standard.set(passed, forKey: Self.passedVersionsKey)
}
// MARK: - Active version
@@ -248,12 +274,18 @@ final class VPhoneLaunchpadCoreBundle {
// MARK: - Refresh
func refresh() async {
+ await checkActive()
+ await fetchReleases()
+ await fetchArtifacts()
+ }
+
+ /// Rereads the store and checks the active bundle again. A bundle that
+ /// passed keeps showing so while the check runs.
+ func checkActive() async {
loadInstalled()
if let version = activeVersion {
- await verify(version)
+ await verify(version, showsProgress: false)
}
- await fetchReleases()
- await fetchArtifacts()
}
func fetchReleases() async {
@@ -310,7 +342,9 @@ final class VPhoneLaunchpadCoreBundle {
/// Adds the execution policy exception, allows an AMFI-refused VM through
/// the root helper, and runs host preflight again for confirmation.
- func verify(_ version: String) async {
+ /// Without `showsProgress`, a bundle that passed before is not marked
+ /// running meanwhile.
+ func verify(_ version: String, showsProgress: Bool = true) async {
guard VPhoneLaunchpadNames.isCompatibleBundleVersion(version) else {
update(version) {
$0.policy = .failed
@@ -319,9 +353,12 @@ final class VPhoneLaunchpadCoreBundle {
}
return
}
+ defer { recordCheck(version) }
update(version) {
- $0.policy = .running
- $0.preflight = .running
+ if showsProgress || $0.policy != .passed || $0.preflight != .passed {
+ $0.policy = .running
+ $0.preflight = .running
+ }
}
let bundle = VPhoneLaunchpadBundleStore.bundle(version: version)
do {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift
index 646f3838..67fc6714 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/CoreBundle/VPhoneLaunchpadCoreBundleView.swift
@@ -177,12 +177,12 @@ struct VPhoneLaunchpadCoreBundleView: View {
case .passed: String(localized: "Preflight passed")
case .warning: String(localized: "Preflight skipped")
case .pending: String(localized: "Not checked")
- case .failed: bundle.policy != .passed ? String(localized: "No policy exception") : String(localized: "Preflight failed")
+ case .failed: bundle.policy != .passed ? String(localized: "Not allowed to run") : String(localized: "Preflight failed")
}
}
private func checkHelp(_ bundle: VPhoneLaunchpadCoreBundle.Installed) -> String {
- let policy = bundle.policy == .passed ? String(localized: "Policy exception added.") : String(localized: "No policy exception.")
+ let policy = bundle.policy == .passed ? String(localized: "Allowed to run.") : String(localized: "Not allowed to run.")
return bundle.preflightDetail.isEmpty ? policy : "\(policy)\n\(bundle.preflightDetail)"
}
@@ -228,7 +228,7 @@ struct VPhoneLaunchpadCoreBundleView: View {
Text("Available")
} footer: {
if source == .actions {
- Text("Builds from the package workflow, kept by GitHub for 7 days. Downloading them needs a token that can read Actions for Lakr233/vphone-cli. It is stored in your keychain.")
+ Text("Builds from GitHub Actions, kept for 7 days. To download them, add a token that can read Actions for Lakr233/vphone-cli. The token is stored in your keychain.")
.foregroundStyle(.secondary)
}
}
@@ -344,10 +344,9 @@ struct VPhoneLaunchpadCoreBundleView: View {
panel.treatsFilePackagesAsDirectories = false
panel.allowsMultipleSelection = false
panel.allowedContentTypes = [.zip, .bundle]
- guard panel.runModal() == .OK, let url = panel.url else {
- return
+ panel.present { url in
+ Task { await model.installLocalBundle(url) }
}
- Task { await model.installLocalBundle(url) }
}
// MARK: - Formatting
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHelperClient.swift b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHelperClient.swift
index 0f3c75d9..b76c9f8a 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHelperClient.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHelperClient.swift
@@ -25,6 +25,10 @@ final class VPhoneLaunchpadHelperClient {
private nonisolated static let label = VPhoneLaunchpadHelperIdentity.label
+ init() {
+ state = installedState()
+ }
+
// MARK: - Status
/// CFBundleVersion of the helper embedded in this app.
@@ -61,22 +65,35 @@ final class VPhoneLaunchpadHelperClient {
return !helperRequirement.contains("subject.OU] = \"\"")
}
- func refresh() async {
+ /// What the files on disk say, without asking the helper. A helper
+ /// identical to the embedded copy counts as ready until XPC says
+ /// otherwise, so launch shows it installed straight away.
+ private func installedState() -> State {
guard isConfigured else {
- state = .unconfigured
- return
+ return .unconfigured
}
let hasJob = FileManager.default.fileExists(atPath: "/Library/LaunchDaemons/\(Self.label).plist")
let hasExecutable = FileManager.default.fileExists(atPath: installedHelper.path)
guard hasJob || hasExecutable else {
- state = .notInstalled
- return
+ return .notInstalled
}
let bundled = bundledVersion ?? "?"
guard hasJob, hasExecutable else {
- state = .outdated(installed: "unknown", bundled: bundled)
+ return .outdated(installed: "unknown", bundled: bundled)
+ }
+ return installedHelperMatches ? .ready(bundled) : .unknown
+ }
+
+ func refresh() async {
+ let installed = installedState()
+ switch installed {
+ case .unconfigured, .notInstalled, .outdated:
+ state = installed
return
+ case .unknown, .ready:
+ break
}
+ let bundled = bundledVersion ?? "?"
do {
let installed = try await version()
state = installed == bundled && installedHelperMatches
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetup.swift b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetup.swift
index 416e9ce4..473fb834 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetup.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetup.swift
@@ -64,6 +64,7 @@ final class VPhoneLaunchpadHostSetup {
init(helper: VPhoneLaunchpadHelperClient, libraryRoot: URL) {
self.helper = helper
self.libraryRoot = libraryRoot
+ checkLocally()
}
var required: [VPhoneLaunchpadHostCheck] {
@@ -145,19 +146,28 @@ final class VPhoneLaunchpadHostSetup {
isChecking = true
defer { isChecking = false }
+ checkLocally()
+ if checks.first(where: { $0.kind == .network })?.status == .pending {
+ update(.network, (.running, String(localized: "Checking…")))
+ }
+ // The helper and network rows keep their last result until these
+ // answer, so a recheck does not blank them.
+ await helper.refresh()
+ update(.helper, helperStatus())
+ await update(.network, Self.network())
+ }
+
+ /// The checks that need no helper or network. They run at init, so the
+ /// first frame already shows them.
+ private func checkLocally() {
update(.appleSilicon, Self.appleSilicon())
update(.macOS, Self.macOSVersion())
update(.physicalMac, Self.physicalMac())
update(.libraryVolume, Self.libraryVolume(libraryRoot))
update(.developerTools, developerTools())
- update(.helper, (.running, String(localized: "Checking…")))
+ update(.helper, helperStatus())
update(.diskSpace, Self.diskSpace(libraryRoot))
update(.resources, Self.resources())
- update(.network, (.running, String(localized: "Checking…")))
-
- await helper.refresh()
- update(.helper, helperStatus())
- await update(.network, Self.network())
}
/// Re-reads Developer Tools access alone, for when the app comes back
@@ -251,7 +261,7 @@ final class VPhoneLaunchpadHostSetup {
case let .ready(version):
(.passed, String(localized: "Version \(version)"))
case .unconfigured:
- (.failed, String(localized: "No signing team in this build"))
+ (.failed, String(localized: "Not available in this build"))
}
}
@@ -292,7 +302,7 @@ final class VPhoneLaunchpadHostSetup {
let type = withUnsafeBytes(of: info.f_fstypename) { String(decoding: $0.prefix { $0 != 0 }, as: UTF8.self) }
return type == "apfs"
? (.passed, abbreviated(root))
- : (.failed, String(localized: "\(abbreviated(root)) is on \(type)"))
+ : (.failed, String(localized: "\(abbreviated(root)) is on \(type), not APFS"))
}
private nonisolated static func diskSpace(_ root: URL) -> (VPhoneLaunchpadStatus, String) {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift
index d4dff19b..b8f6cbec 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/HostSetup/VPhoneLaunchpadHostSetupView.swift
@@ -3,6 +3,7 @@ import SwiftUI
struct VPhoneLaunchpadHostSetupView: View {
@Environment(VPhoneLaunchpadModel.self) private var model
@Environment(\.dismiss) private var dismiss
+ @AppStorage(VPhoneLaunchpadMenuBar.key) private var showsInMenuBar = false
private var host: VPhoneLaunchpadHostSetup {
model.host
@@ -44,6 +45,13 @@ struct VPhoneLaunchpadHostSetupView: View {
Text("Advisory checks do not block setup.")
.foregroundStyle(.secondary)
}
+
+ Section {
+ Toggle("Keep in Menu Bar", isOn: $showsInMenuBar)
+ } footer: {
+ Text("Closing the window keeps Launchpad in the menu bar, where you can start and stop machines. The Dock icon appears only while a window or the menu is open.")
+ .foregroundStyle(.secondary)
+ }
}
.formStyle(.grouped)
.navigationTitle("Host Setup")
@@ -120,7 +128,7 @@ struct VPhoneLaunchpadHostSetupView: View {
Button("Don’t Skip") { host.setSkipped(check.kind, false) }
} else if host.canSkip(check) {
Button("Skip") { host.setSkipped(check.kind, true) }
- .help("Continue without this check. The bundle’s own preflight still runs.")
+ .help("Continue without this check. The Core Bundle still runs its own checks.")
}
}
}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings b/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings
index 7f43d966..2a1c97e3 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Localizable.xcstrings
@@ -409,36 +409,36 @@
}
}
},
- "%@ is on %@" : {
+ "%@ is on %@, not APFS" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "%@ is on %@"
+ "value" : "%@ is on %@, not APFS"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "%1$@ は %2$@ 上にあります"
+ "value" : "%1$@ は APFS ではなく %2$@ 上にあります"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "%1$@이(가) %2$@에 있습니다"
+ "value" : "%1$@이(가) APFS가 아닌 %2$@에 있습니다"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "%1$@ nằm trên %2$@"
+ "value" : "%1$@ nằm trên %2$@, không phải APFS"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "%1$@ 位于 %2$@ 卷宗"
+ "value" : "%1$@ 位于 %2$@ 宗卷,不是 APFS"
}
}
}
@@ -1067,172 +1067,172 @@
}
}
},
- "Add execution policy exception" : {
+ "Administrator authorization failed (OSStatus %d)." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Add execution policy exception"
+ "value" : "Administrator authorization failed (OSStatus %d)."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "実行ポリシーの例外を追加"
+ "value" : "管理者の認証に失敗しました(OSStatus %d)。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "실행 정책 예외 추가"
+ "value" : "관리자 인증에 실패했습니다(OSStatus %d)."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Thêm ngoại lệ chính sách thực thi"
+ "value" : "Xác thực quản trị viên thất bại (OSStatus %d)."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "添加执行策略例外"
+ "value" : "管理员授权失败(OSStatus %d)。"
}
}
}
},
- "Administrator authorization failed (OSStatus %d)." : {
+ "Advisory" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Administrator authorization failed (OSStatus %d)."
+ "value" : "Advisory"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "管理者の認証に失敗しました(OSStatus %d)。"
+ "value" : "推奨"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "관리자 인증에 실패했습니다(OSStatus %d)."
+ "value" : "권장 사항"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Xác thực quản trị viên thất bại (OSStatus %d)."
+ "value" : "Khuyến nghị"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "管理员授权失败(OSStatus %d)。"
+ "value" : "建议"
}
}
}
},
- "Advisory" : {
+ "Advisory checks do not block setup." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Advisory"
+ "value" : "Advisory checks do not block setup."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "推奨"
+ "value" : "推奨項目はセットアップを妨げません。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "권장 사항"
+ "value" : "권장 사항 검사는 설정을 막지 않습니다."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Khuyến nghị"
+ "value" : "Các mục khuyến nghị không chặn quá trình thiết lập."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "建议"
+ "value" : "建议项不会阻止设置。"
}
}
}
},
- "Advisory checks do not block setup." : {
+ "After allowing vphone-launchpad under Privacy & Security → Developer Tools, quit and reopen it." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Advisory checks do not block setup."
+ "value" : "After allowing vphone-launchpad under Privacy & Security → Developer Tools, quit and reopen it."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "推奨項目はセットアップを妨げません。"
+ "value" : "「プライバシーとセキュリティ」→「デベロッパツール」で vphone-launchpad を許可したあと、終了してから開き直してください。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "권장 사항 검사는 설정을 막지 않습니다."
+ "value" : "개인정보 보호 및 보안 → 개발자 도구에서 vphone-launchpad를 허용한 후 종료했다가 다시 여십시오."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Các mục khuyến nghị không chặn quá trình thiết lập."
+ "value" : "Sau khi cho phép vphone-launchpad trong Quyền riêng tư & Bảo mật → Công cụ dành cho nhà phát triển, hãy thoát rồi mở lại ứng dụng."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "建议项不会阻止设置。"
+ "value" : "在“隐私与安全性”→“开发者工具”中允许 vphone-launchpad 后,请退出并重新打开它。"
}
}
}
},
- "After allowing vphone-launchpad under Privacy & Security → Developer Tools, quit and reopen it." : {
+ "Allow bundle to run" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "After allowing vphone-launchpad under Privacy & Security → Developer Tools, quit and reopen it."
+ "value" : "Allow bundle to run"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "「プライバシーとセキュリティ」→「デベロッパツール」で vphone-launchpad を許可したあと、終了してから開き直してください。"
+ "value" : "バンドルの実行を許可"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "개인정보 보호 및 보안 → 개발자 도구에서 vphone-launchpad를 허용한 후 종료했다가 다시 여십시오."
+ "value" : "번들 실행 허용"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Sau khi cho phép vphone-launchpad trong Quyền riêng tư & Bảo mật → Công cụ dành cho nhà phát triển, hãy thoát rồi mở lại ứng dụng."
+ "value" : "Cho phép bundle chạy"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "在“隐私与安全性”→“开发者工具”中允许 vphone-launchpad 后,请退出并重新打开它。"
+ "value" : "允许 bundle 运行"
}
}
}
@@ -1305,6 +1305,40 @@
}
}
},
+ "Allowed to run." : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Allowed to run."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "実行が許可されています。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "실행이 허용되었습니다."
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Đã được phép chạy."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已允许运行。"
+ }
+ }
+ }
+ },
"An install is in progress. Follow it in the inspector." : {
"localizations" : {
"en" : {
@@ -1509,36 +1543,36 @@
}
}
},
- "Builds from the package workflow, kept by GitHub for 7 days. Downloading them needs a token that can read Actions for Lakr233/vphone-cli. It is stored in your keychain." : {
+ "Builds from GitHub Actions, kept for 7 days. To download them, add a token that can read Actions for Lakr233/vphone-cli. The token is stored in your keychain." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Builds from the package workflow, kept by GitHub for 7 days. Downloading them needs a token that can read Actions for Lakr233/vphone-cli. It is stored in your keychain."
+ "value" : "Builds from GitHub Actions, kept for 7 days. To download them, add a token that can read Actions for Lakr233/vphone-cli. The token is stored in your keychain."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "パッケージワークフローのビルドで、GitHub に 7 日間保持されます。ダウンロードには、Lakr233/vphone-cli の Actions を読み取れるトークンが必要です。トークンはキーチェーンに保存されます。"
+ "value" : "GitHub Actions のビルドで、7 日間保持されます。ダウンロードするには、Lakr233/vphone-cli の Actions を読み取れるトークンを追加してください。トークンはキーチェーンに保存されます。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "패키지 워크플로의 빌드로, GitHub에 7일간 보관됩니다. 다운로드하려면 Lakr233/vphone-cli의 Actions를 읽을 수 있는 토큰이 필요합니다. 토큰은 키체인에 저장됩니다."
+ "value" : "GitHub Actions의 빌드로, 7일간 보관됩니다. 다운로드하려면 Lakr233/vphone-cli의 Actions를 읽을 수 있는 토큰을 추가하십시오. 토큰은 키체인에 저장됩니다."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Các bản dựng từ quy trình đóng gói, được GitHub lưu giữ trong 7 ngày. Để tải xuống, cần token có quyền đọc Actions của Lakr233/vphone-cli. Token được lưu trong chuỗi khóa của bạn."
+ "value" : "Các bản dựng từ GitHub Actions, được lưu giữ trong 7 ngày. Để tải xuống, hãy thêm token có quyền đọc Actions của Lakr233/vphone-cli. Token được lưu trong chuỗi khóa của bạn."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "来自打包工作流程的构建版本,GitHub 会保留 7 天。下载需要一个可读取 Lakr233/vphone-cli 的 Actions 的令牌,令牌存储在你的钥匙串中。"
+ "value" : "来自 GitHub Actions 的构建版本,保留 7 天。如需下载,请添加一个可读取 Lakr233/vphone-cli 的 Actions 的令牌。令牌存储在你的钥匙串中。"
}
}
}
@@ -1951,104 +1985,104 @@
}
}
},
- "Choose a .tzst or .txz archive made by Export." : {
+ "Choose a Location" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Choose a .tzst or .txz archive made by Export."
+ "value" : "Choose a Location"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "「書き出す」で作成した .tzst または .txz アーカイブを選択してください。"
+ "value" : "場所を選択"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "내보내기로 만든 .tzst 또는 .txz 아카이브를 선택하십시오."
+ "value" : "위치 선택"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Chọn tệp lưu trữ .tzst hoặc .txz được tạo bằng Xuất."
+ "value" : "Chọn vị trí"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "选择由“导出”生成的 .tzst 或 .txz 归档。"
+ "value" : "选取位置"
}
}
}
},
- "Choose a Location" : {
+ "Choose a VPhone.bundle folder or a .zip that contains one." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Choose a Location"
+ "value" : "Choose a VPhone.bundle folder or a .zip that contains one."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "場所を選択"
+ "value" : "VPhone.bundle フォルダ、またはそれを含む .zip を選択してください。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "위치 선택"
+ "value" : "VPhone.bundle 폴더 또는 이를 포함하는 .zip을 선택하십시오."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Chọn vị trí"
+ "value" : "Hãy chọn thư mục VPhone.bundle hoặc tệp .zip chứa nó."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "选取位置"
+ "value" : "选择 VPhone.bundle 文件夹或包含它的 .zip。"
}
}
}
},
- "Choose a VPhone.bundle folder or a .zip that contains one." : {
+ "Choose an exported machine archive (.tzst or .txz)." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Choose a VPhone.bundle folder or a .zip that contains one."
+ "value" : "Choose an exported machine archive (.tzst or .txz)."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "VPhone.bundle フォルダ、またはそれを含む .zip を選択してください。"
+ "value" : "書き出したマシンのアーカイブ(.tzst または .txz)を選択してください。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "VPhone.bundle 폴더 또는 이를 포함하는 .zip을 선택하십시오."
+ "value" : "내보낸 머신 아카이브(.tzst 또는 .txz)를 선택하십시오."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Hãy chọn thư mục VPhone.bundle hoặc tệp .zip chứa nó."
+ "value" : "Chọn tệp lưu trữ máy đã xuất (.tzst hoặc .txz)."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "选择 VPhone.bundle 文件夹或包含它的 .zip。"
+ "value" : "选择导出的机器归档(.tzst 或 .txz)。"
}
}
}
@@ -2325,6 +2359,40 @@
}
}
},
+ "Closing the window keeps Launchpad in the menu bar, where you can start and stop machines. The Dock icon appears only while a window or the menu is open." : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Closing the window keeps Launchpad in the menu bar, where you can start and stop machines. The Dock icon appears only while a window or the menu is open."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "ウインドウを閉じても Launchpad はメニューバーに残り、メニューバーからマシンを開始・停止できます。Dock アイコンは、ウインドウかメニューが開いているときだけ表示されます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "윈도우를 닫아도 Launchpad가 메뉴 막대에 남아 있으며, 메뉴 막대에서 머신을 시작하고 중지할 수 있습니다. Dock 아이콘은 윈도우나 메뉴가 열려 있을 때만 표시됩니다."
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Khi đóng cửa sổ, Launchpad vẫn nằm trên thanh menu, nơi bạn có thể khởi động và dừng máy. Biểu tượng trong Dock chỉ hiện khi có cửa sổ hoặc menu đang mở."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "关闭窗口后,Launchpad 会保留在菜单栏中,你可以从菜单栏启动和停止机器。只有在窗口或菜单打开时,Dock 中才会显示图标。"
+ }
+ }
+ }
+ },
"Closing this window keeps it running." : {
"localizations" : {
"en" : {
@@ -2563,36 +2631,36 @@
}
}
},
- "Continue without this check. The bundle’s own preflight still runs." : {
+ "Continue without this check. The Core Bundle still runs its own checks." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Continue without this check. The bundle’s own preflight still runs."
+ "value" : "Continue without this check. The Core Bundle still runs its own checks."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "このチェックなしで続行します。バンドル自体の事前チェックは引き続き実行されます。"
+ "value" : "このチェックなしで続行します。コアバンドル自体のチェックは引き続き実行されます。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "이 검사 없이 계속합니다. 번들 자체의 사전 점검은 계속 실행됩니다."
+ "value" : "이 검사 없이 계속합니다. 코어 번들 자체의 검사는 계속 실행됩니다."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Tiếp tục mà không có mục kiểm tra này. Bundle vẫn chạy kiểm tra trước của riêng nó."
+ "value" : "Tiếp tục mà không có mục kiểm tra này. Bundle lõi vẫn chạy các kiểm tra của riêng nó."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "不经此项检查继续。bundle 自身的预检仍会运行。"
+ "value" : "跳过此项检查继续。核心 Bundle 仍会运行自己的检查。"
}
}
}
@@ -4275,40 +4343,6 @@
}
}
},
- "Frida Stalker kernel relaxations" : {
- "localizations" : {
- "en" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Frida Stalker kernel relaxations"
- }
- },
- "ja" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Frida Stalker 向けのカーネル制限緩和"
- }
- },
- "ko" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Frida Stalker용 커널 제한 완화"
- }
- },
- "vi" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Nới lỏng kernel cho Frida Stalker"
- }
- },
- "zh-Hans" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "放宽内核限制以支持 Frida Stalker"
- }
- }
- }
- },
"GitHub Actions" : {
"localizations" : {
"en" : {
@@ -5737,36 +5771,70 @@
}
}
},
- "Keep the prepared restore tree" : {
+ "Keep in Menu Bar" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Keep the prepared restore tree"
+ "value" : "Keep in Menu Bar"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "準備した復元ツリーを残す"
+ "value" : "メニューバーに常駐"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "준비된 복원 트리 유지"
+ "value" : "메뉴 막대에 유지"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Giữ lại cây khôi phục đã chuẩn bị"
+ "value" : "Giữ trên thanh menu"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "保留准备好的恢复目录"
+ "value" : "常驻菜单栏"
+ }
+ }
+ }
+ },
+ "Keep prepared restore files" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Keep prepared restore files"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "準備した復元ファイルを残す"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "준비된 복원 파일 유지"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Giữ lại các tệp khôi phục đã chuẩn bị"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "保留准备好的恢复文件"
}
}
}
@@ -6859,240 +6927,240 @@
}
}
},
- "No policy exception" : {
+ "No Selection" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "No policy exception"
+ "value" : "No Selection"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "ポリシーの例外なし"
+ "value" : "選択されていません"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "정책 예외 없음"
+ "value" : "선택 항목 없음"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Không có ngoại lệ chính sách"
+ "value" : "Chưa chọn"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "无策略例外"
+ "value" : "未选择"
}
}
}
},
- "No policy exception." : {
+ "None" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "No policy exception."
+ "value" : "None"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "ポリシーの例外はありません。"
+ "value" : "なし"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "정책 예외가 없습니다."
+ "value" : "없음"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Không có ngoại lệ chính sách."
+ "value" : "Không có"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "无策略例外。"
+ "value" : "无"
}
}
}
},
- "No Selection" : {
+ "Not a virtual machine" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "No Selection"
+ "value" : "Not a virtual machine"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "選択されていません"
+ "value" : "仮想マシンではありません"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "선택 항목 없음"
+ "value" : "가상 머신 아님"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Chưa chọn"
+ "value" : "Không phải máy ảo"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "未选择"
+ "value" : "非虚拟机"
}
}
}
},
- "No signing team in this build" : {
+ "Not allowed" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "No signing team in this build"
+ "value" : "Not allowed"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "このビルドには署名チームがありません"
+ "value" : "許可されていません"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "이 빌드에 서명 팀이 없습니다"
+ "value" : "허용되지 않음"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Bản dựng này không có nhóm ký"
+ "value" : "Chưa cho phép"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "此构建版本没有签名团队"
+ "value" : "未允许"
}
}
}
},
- "None" : {
+ "Not allowed to run" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "None"
+ "value" : "Not allowed to run"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "なし"
+ "value" : "実行が許可されていません"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "없음"
+ "value" : "실행이 허용되지 않음"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Không có"
+ "value" : "Chưa được phép chạy"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "无"
+ "value" : "未允许运行"
}
}
}
},
- "Not a virtual machine" : {
+ "Not allowed to run." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Not a virtual machine"
+ "value" : "Not allowed to run."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "仮想マシンではありません"
+ "value" : "実行が許可されていません。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "가상 머신 아님"
+ "value" : "실행이 허용되지 않았습니다."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Không phải máy ảo"
+ "value" : "Chưa được phép chạy."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "非虚拟机"
+ "value" : "未允许运行。"
}
}
}
},
- "Not allowed" : {
+ "Not available in this build" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Not allowed"
+ "value" : "Not available in this build"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "許可されていません"
+ "value" : "このビルドでは利用できません"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "허용되지 않음"
+ "value" : "이 빌드에서는 사용할 수 없음"
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Chưa cho phép"
+ "value" : "Không có trong bản dựng này"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "未允许"
+ "value" : "此构建版本中不可用"
}
}
}
@@ -7301,6 +7369,40 @@
}
}
},
+ "Open Launchpad" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Open Launchpad"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Launchpad を開く"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Launchpad 열기"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Mở Launchpad"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "打开 Launchpad"
+ }
+ }
+ }
+ },
"Open Log" : {
"localizations" : {
"en" : {
@@ -7641,40 +7743,6 @@
}
}
},
- "Policy exception added." : {
- "localizations" : {
- "en" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Policy exception added."
- }
- },
- "ja" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "ポリシーの例外を追加しました。"
- }
- },
- "ko" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "정책 예외가 추가되었습니다."
- }
- },
- "vi" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Đã thêm ngoại lệ chính sách."
- }
- },
- "zh-Hans" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "已添加策略例外。"
- }
- }
- }
- },
"Pre-release" : {
"localizations" : {
"en" : {
@@ -8151,6 +8219,40 @@
}
}
},
+ "Relax kernel restrictions for Frida Stalker" : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Relax kernel restrictions for Frida Stalker"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Frida Stalker 向けにカーネル制限を緩和"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Frida Stalker용 커널 제한 완화"
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nới lỏng giới hạn kernel cho Frida Stalker"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "放宽内核限制以支持 Frida Stalker"
+ }
+ }
+ }
+ },
"Releases" : {
"localizations" : {
"en" : {
@@ -10225,40 +10327,6 @@
}
}
},
- "The artifact does not contain a VPhone bundle zip." : {
- "localizations" : {
- "en" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "The artifact does not contain a VPhone bundle zip."
- }
- },
- "ja" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "アーティファクトに VPhone バンドルの zip が含まれていません。"
- }
- },
- "ko" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "아티팩트에 VPhone 번들 zip이 없습니다."
- }
- },
- "vi" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Artifact không chứa tệp zip của bundle VPhone."
- }
- },
- "zh-Hans" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "此构建产物不包含 VPhone bundle 的 zip 文件。"
- }
- }
- }
- },
"The clone boots as a new device. SEP storage is copied as is, so a restored machine may need restoring again." : {
"localizations" : {
"en" : {
@@ -11075,6 +11143,40 @@
}
}
},
+ "This build does not contain VPhone.bundle. Choose another build." : {
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "This build does not contain VPhone.bundle. Choose another build."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このビルドには VPhone.bundle が含まれていません。別のビルドを選択してください。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 빌드에는 VPhone.bundle이 없습니다. 다른 빌드를 선택하십시오."
+ }
+ },
+ "vi" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bản dựng này không chứa VPhone.bundle. Hãy chọn bản dựng khác."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此构建版本不包含 VPhone.bundle。请选择其他构建版本。"
+ }
+ }
+ }
+ },
"This build has expired on GitHub. Choose a newer one." : {
"localizations" : {
"en" : {
@@ -11993,40 +12095,6 @@
}
}
},
- "Use letters, digits, dots, dashes and underscores." : {
- "localizations" : {
- "en" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Use letters, digits, dots, dashes and underscores."
- }
- },
- "ja" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "英字、数字、ピリオド、ハイフン、アンダースコアを使用してください。"
- }
- },
- "ko" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "문자, 숫자, 마침표, 하이픈, 밑줄을 사용하십시오."
- }
- },
- "vi" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "Hãy dùng chữ cái, chữ số, dấu chấm, gạch ngang và gạch dưới."
- }
- },
- "zh-Hans" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "请使用字母、数字、句点、连字符和下划线。"
- }
- }
- }
- },
"Use letters, numbers, periods, hyphens, and underscores." : {
"localizations" : {
"en" : {
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineLibrary.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineLibrary.swift
index f7ea8ef8..1155e46a 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineLibrary.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineLibrary.swift
@@ -20,6 +20,9 @@ final class VPhoneLaunchpadMachineLibrary {
private(set) var machines: [VPhoneLaunchpadMachine] = []
private(set) var listError: String?
+ /// False until the first `vm list` answers, so the window does not show
+ /// "No Machines" before it knows.
+ private(set) var hasListed = false
private(set) var startedAt: [Path: Date] = [:]
/// Machines whose console printed a panic since Launchpad last started
/// them. The console text itself stays in the log file.
@@ -183,6 +186,7 @@ final class VPhoneLaunchpadMachineLibrary {
}
machines = found
listError = errors.first
+ hasListed = true
forgetEmptyLocations(listed: listed)
if selection == nil || !machines.contains(where: { $0.id == selection }) {
selection = machines.first?.id
@@ -407,6 +411,7 @@ final class VPhoneLaunchpadMachineLibrary {
extension VPhoneLaunchpadMachineLibrary {
func applyPreview(creation: VPhoneLaunchpadCreationPipeline) {
machines = VPhoneLaunchpadPreview.machines
+ hasListed = true
externallyRunning = [VPhoneLaunchpadPreview.path("research-01")]
startedAt = [VPhoneLaunchpadPreview.path("research-01"): Date().addingTimeInterval(-6130)]
creations = [creation.machine: creation]
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineSheets.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineSheets.swift
index 3eaddf56..914e46a2 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineSheets.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachineSheets.swift
@@ -167,12 +167,11 @@ struct VPhoneLaunchpadExportView: View {
let panel = NSSavePanel()
panel.title = String(localized: "Export \(name)")
panel.nameFieldStringValue = "\(name).\(densest ? "txz" : "tzst")"
- guard panel.runModal() == .OK, let url = panel.url else {
- return
- }
let densest = densest
let includeIPSW = includeIPSW
- Task { await model.machines.export(machine, to: url, densest: densest, includeIPSW: includeIPSW) }
- dismiss()
+ panel.present { url in
+ Task { await model.machines.export(machine, to: url, densest: densest, includeIPSW: includeIPSW) }
+ dismiss()
+ }
}
}
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachinesView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachinesView.swift
index 681dcfb8..499fa92f 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachinesView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadMachinesView.swift
@@ -110,7 +110,13 @@ struct VPhoneLaunchpadMachinesView: View {
private var toolbar: some ToolbarContent {
let selected = library.selected
let state = selected.map { library.state(of: $0.path) }
- ToolbarItemGroup(placement: .primaryAction) {
+ // Host Setup and Core Bundle hold the leading edge; the space pushes
+ // everything here to the trailing edge, in three groups: the selected
+ // machine, the library, and the inspector toggle above the inspector.
+ ToolbarItem(placement: .automatic) {
+ Spacer()
+ }
+ ToolbarItemGroup(placement: .automatic) {
if state == .running, let selected {
Button {
Task { await library.stop(selected.path) }
@@ -135,6 +141,8 @@ struct VPhoneLaunchpadMachinesView: View {
Label("Actions", systemImage: "ellipsis.circle")
}
.disabled(selected == nil)
+ }
+ ToolbarItemGroup(placement: .automatic) {
Button {
chooseImport()
} label: {
@@ -150,10 +158,9 @@ struct VPhoneLaunchpadMachinesView: View {
.help("Create a machine")
.disabled(model.bundles.activeVersion == nil)
}
- // Primary actions sit at the leading edge on macOS; the space pushes
- // the inspector toggle to the trailing edge, above the inspector.
- ToolbarItem(placement: .automatic) {
- Spacer()
+ // Adjacent items share one background on macOS 26.
+ if #available(macOS 26.0, *) {
+ ToolbarSpacer(.fixed)
}
ToolbarItem(placement: .automatic) {
inspectorToggle
@@ -255,6 +262,8 @@ struct VPhoneLaunchpadMachinesView: View {
Button("Set Up…") { model.panel = model.host.requiredPassed ? .coreBundle : .hostSetup }
.buttonStyle(.borderedProminent)
}
+ } else if !library.hasListed {
+ Color.clear
} else {
ContentUnavailableView {
Label("No Machines", systemImage: "iphone")
@@ -306,13 +315,12 @@ struct VPhoneLaunchpadMachinesView: View {
private func chooseImport() {
let panel = NSOpenPanel()
panel.title = String(localized: "Import Machine")
- panel.message = String(localized: "Choose a .tzst or .txz archive made by Export.")
+ panel.message = String(localized: "Choose an exported machine archive (.tzst or .txz).")
panel.canChooseDirectories = false
panel.allowsMultipleSelection = false
- guard panel.runModal() == .OK, let url = panel.url else {
- return
+ panel.present { url in
+ Task { await library.importArchive(url) }
}
- Task { await library.importArchive(url) }
}
// MARK: - Formatting
diff --git a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift
index e70d7d9d..3497af74 100644
--- a/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift
+++ b/VPhoneLaunchpad/VPhoneLaunchpad/Machines/VPhoneLaunchpadNewMachineView.swift
@@ -56,7 +56,7 @@ struct VPhoneLaunchpadNewMachineView: View {
private var nameProblem: String? {
let isDefault = name.trimmingCharacters(in: .whitespaces).isEmpty
if !VPhoneLaunchpadNames.isValidMachineName(effectiveName) {
- return String(localized: "Use letters, digits, dots, dashes and underscores.")
+ return String(localized: "Use letters, numbers, periods, hyphens, and underscores.")
}
if model.machines.machines.contains(where: { $0.path == machine }) || model.machines.creations[machine]?.isRunning == true {
return isDefault
@@ -107,9 +107,9 @@ struct VPhoneLaunchpadNewMachineView: View {
}
Section {
- Toggle("Frida Stalker kernel relaxations", isOn: $enableFrida)
+ Toggle("Relax kernel restrictions for Frida Stalker", isOn: $enableFrida)
Toggle("Disable dyld shared cache randomization", isOn: $forceMaxSlide)
- Toggle("Keep the prepared restore tree", isOn: $keepArtifacts)
+ Toggle("Keep prepared restore files", isOn: $keepArtifacts)
} header: {
Text("Options")
} footer: {
@@ -177,9 +177,12 @@ struct VPhoneLaunchpadNewMachineView: View {
panel.canCreateDirectories = true
panel.allowsMultipleSelection = false
panel.directoryURL = URL(fileURLWithPath: location, isDirectory: true)
- guard panel.runModal() == .OK, let url = panel.url else {
- return
+ panel.present { url in
+ useLocation(url)
}
+ }
+
+ private func useLocation(_ url: URL) {
let root = VPhoneLaunchpadMachineLocations.canonical(url)
if !model.machines.roots.contains(root) {
chosenLocation = root
@@ -239,7 +242,7 @@ struct VPhoneLaunchpadNewMachineView: View {
Button("Choose…") {
let panel = NSOpenPanel()
panel.canChooseDirectories = false
- if panel.runModal() == .OK, let url = panel.url {
+ panel.present { url in
text.wrappedValue = url.path
}
}