Skip to content
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

SpotlightSearch isn't returning results that are on desktop and are found with terminal mdfind command #41

Open
edorphy opened this issue Feb 2, 2024 · 1 comment

Comments

@edorphy
Copy link

edorphy commented Feb 2, 2024

For some reason the spotlight search (NSMetadataQuery) isn't finding a .DSYM that is in my desktop directory automatically. I know the UUID is correct because running the mdfind command in terminal has no problem.

I was looking through historical issues related to "com_apple_xcode_dsym_uuids" and I'm wondering if this isn't working as expected again. #16

My machine is running macOS Sonoma 14.2.1 (23C71)

user@directory % mdfind "com_apple_xcode_dsym_uuids == E3D58A29-035A-37E5-A5FD-01C818692997"
/Users/user/Desktop/DSYMS/AppName.app.dSYM

Trying to force the app to search for it in the symbolicate button yields no results. From Xcode Version 15.2 (15C500b)

    @objc func symbolicate() {
        spotlight.search(forUUIDs: ["E3D58A29-035A-37E5-A5FD-01C818692997"]) { result in
            print(result)
        }

--> Optional([])

Thoughts on having a settings option the user can turn on to run the mdfind command in a Process if the spotlight search came up empty?

From the same project, this works:

    @objc func symbolicate() {
        let command = "mdfind \"com_apple_xcode_dsym_uuids == E3D58A29-035A-37E5-A5FD-01C818692997\""
        let result = command.run()
        print(result.output ?? "no results")

--> /Users/user/Desktop/DSYMS/AppName.app.dSYM

@inket
Copy link
Owner

inket commented Mar 2, 2024

Hi @edorphy! Thanks for reporting this.

I looked deeply into this and I was able to reproduce it (but had to put the DSYM in Desktop as well). I believe NSMetadataSearchQuery will only find DSYMs in directories that the user has allowed MacSymbolicator to access. This is part of macOS sandboxing.

I think the solution might be to make MacSymbolicator ask for Full Disk Access permission so that it's able to find all DSYMs on disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants