-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI app discovery broken under certain circumstances (utmctl
symlink)
#6628
Comments
How are you calling utmctl? |
Oh, silly me 😅 $ utmctl list
2024-08-27 11:05:23.455 utmctl[37164:17429559] Can't find app with file path /Applications/UTM.app
Error: Application not found. |
utmctl
symlink)
Can you run |
lrwxr-xr-x 1 username admin 58 Aug 27 11:00 /opt/homebrew/bin/utmctl -> /Users/username/Applications/UTM.app/Contents/MacOS/utmctl |
I've been playing around with this and it seems like it's actually not possible for a sandboxed CLI app to know what's its own real path is. /// Find the path to UTM.app
private var utmAppUrl: URL {
if let executableURL = Bundle.main.executableURL?.resolvingSymlinksInPath() {
let utmURL = executableURL.deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent()
if utmURL.lastPathComponent == "UTM.app" {
return utmURL
}
}
return URL(fileURLWithPath: "/Applications/UTM.app")
} This returns the default path if it cannot determine the correct path. However, when you symlink, The workaround is if you add |
That's too bad, but thanks for investigating!
I never knew what
Yeah, I figured that'd probably end up being the solution, though I'd rather it not be (my |
It is indeed distributed on MAS. And also because of the added security (if there's a QEMU bug, it won't automatically be able to rw your entire drive). |
Oh, yeah 🤦♂️
I'm glad to hear that 😅 |
Describe the issue
I don't have admin permissions, but I do have homebrew, so I installed UTM via homebrew with
--appdir=~/Applications/
.utmctl
, however, errors as follows:I filed an issue over at Homebrew/homebrew-cask#182568, and I was directed to file an issue here.
Configuration
Crash log
n/a
Debug log
n/a
Upload VM
n/a
I haven't written Swift in ages, but I'm happy to try to fix it.
The text was updated successfully, but these errors were encountered: