Single application not showing up in Spotlight
Go to System Preferences --> Spotlight --> Privacy
. While that's open, go to Finder --> Applications
and drag Matlab from Applications
into Privacy
. Close out System Preferences
then reopen it and remove Matlab from the same place.
This will force a reindex for Spotlight
. I've seen this work for some people and not for others but it's worth a shot.
In a terminal, enter:
sudo mdutil -E /
I tried the Preferences --> Spotlight --> Privacy
suggestion with the /Applications
folder but that did not work for me.
Then I tried sudo mdutil -E /Applications
in a terminal, and that didn't work either.
It's possible that using the Preferences --> Spotlight --> Privacy
suggestion with the entire disk would have worked also, but in any case, I find typing that single command (sudo mdutil -E /
) on the command line easier.
This command starts the reindexing process and then quickly exits, so it may take a while after it has run for your application to be accessible via Spotlight. An easy way to see if it's still indexing is to start spotlight (command-space) and type at least 1 character. If it's reindexing, it will say "Indexing" just below the text entry field.
I've never tried it, but running mdimport -d1 /Applications/Matlab_R2015b.app
in the Terminal might work as well. You can increase the number up to 4 for increasing debugging information, which might tell you why the indexing isn't working. You can find other command line options at mdimport
's man page.
I had a very similar issue recently where some apps just didn't want to show up after moving all my data to a new Mac. I tried all the suggested solutions, yet nothing has helped. Inspecting the apps in more details, I noticed that they had "eXtended ATTRibutes" (xattr
) which were named:
com.apple.finder.copy.source.inode#N
com.apple.finder.copy.source.volumeuuid#N
These attributes, among others, are set when files are copied within Finder. In case you ever wondered why apps getting copied are grayed out until the copy has finished and how the Finder can show copy progress within the Finder window itself (and not just within the copy dialog) - that's all done by different kind of attributes that are set on the file and telling the system that this file/folder/bundle is just being copied and how much of it already was copied.
Usually Finder removes all these attributes after copy, but somehow these attributes got stuck in my case and with these attributes set, Spotlight refuses to show the apps, thinking they are still in the process of getting copied.
I had to manually remove them to fix that problem:
xattr -d com.apple.finder.copy.source.inode#N PATH
xattr -d com.apple.finder.copy.source.volumeuuid#N PATH
With PATH
being the full path to the application (just drag it from Finder into a Terminal window and the full path is written there). Depending on access permissions/ownership, you may have to prepend the commands with sudo
to gain extended privileges.
I thought it may be helpful to share that information with the world, that's why I'm posting it here.