Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

Record each dependency check in deps-check.txt, so a panel that disagrees with the terminal can be read

seedds31b7598e5453
diff --git a/frontend/README.md b/frontend/README.md
index aed7a13d..6bee85f2 100644
--- a/frontend/README.md
+++ b/frontend/README.md
@@ -45,6 +45,12 @@ check; this session's last build command and the last 50 lines of its log. The h
folder is shown as `~`, a log line holding key material (`name = <hex>`, as in
`prod.keys`) keeps only its name, and no environment variables are included.
+Every dependency check also writes `deps-check.txt` beside `library.json`
+(`~/Library/Application Support/NS Port Builder/`): each row's verdict, the
+interpreter paths that were tried, and the `HOME` and `PATH` the panel ran with.
+That is the file to attach when the panel and the terminal disagree — a Finder
+launch gives the app a different PATH from the shell's.
+
A completed Mac build appears in the collection automatically and can be started
with **Play**. An iPhone build, by default, offers its unsigned IPA and the
sideloading and RomFS-copy instructions.
diff --git a/frontend/Sources/NSPortBuilder/ContentView.swift b/frontend/Sources/NSPortBuilder/ContentView.swift
index d39f8dc3..dc79e5d2 100644
--- a/frontend/Sources/NSPortBuilder/ContentView.swift
+++ b/frontend/Sources/NSPortBuilder/ContentView.swift
@@ -2189,6 +2189,7 @@ final class BuildModel: ObservableObject {
depsChecked = false
DispatchQueue.global(qos: .userInitiated).async {
let d = Self.detectDepsSync()
+ Self.writeDepsReport(d)
let (py, _) = Self.findPython()
let (dn, _) = Self.findDotnet()
DispatchQueue.main.async {
@@ -2200,6 +2201,26 @@ final class BuildModel: ObservableObject {
}
}
+ /// Write what the panel just decided beside library.json (`deps-check.txt`).
+ ///
+ /// The panel is the only place those verdicts appear, so "it says Python is missing" cannot be
+ /// checked afterwards: the interpreter that was tried, and the environment a Finder launch
+ /// gives the app (its PATH is /usr/bin:/bin:/usr/sbin:/sbin, unlike the terminal's), are both
+ /// invisible in a bug report. This file has them — paths and versions only, never key material.
+ nonisolated static func writeDepsReport(_ deps: [Dep]) {
+ let dir = (venvDir as NSString).deletingLastPathComponent
+ try? FileManager.default.createDirectory(atPath: dir, withIntermediateDirectories: true)
+ var out = "NX2Apple \(appVersion) dependency check\n"
+ out += "date: \(ISO8601DateFormatter().string(from: Date()))\n"
+ out += "HOME: \(NSHomeDirectory())\n"
+ out += "PATH: \(ProcessInfo.processInfo.environment["PATH"] ?? "(unset)")\n"
+ out += "python candidates:\n"
+ for c in pythonCandidates() { out += " \(c)\n" }
+ out += "rows:\n"
+ for d in deps { out += " \(d.id): \(d.present ? "ok" : "MISSING") \(d.detail)\n" }
+ try? out.write(toFile: dir + "/deps-check.txt", atomically: true, encoding: .utf8)
+ }
+
func installDep(_ dep: Dep) {
guard !dep.installCmd.isEmpty else {
NSWorkspace.shared.open(URL(fileURLWithPath: "/Applications/App Store.app"))