How can I tell Spotlight to index my .dSYM bundles?

herzbube

Today was the first time that I tried - and failed - to symbolicate a crash log on a newly bought MacBook (let's call this machine MB1). MB1 came with Mac OS X 10.9 pre-installed. I tracked the problem of the failing symbolication down to Spotlight not indexing any of my .dSYM bundles (without the Spotlight index, Apple's symbolicatecrash script fails to locate the .dSYM bundle that matches the crash log). I came to my conclusion because

mdfind "com_apple_xcode_dsym_uuids == *"

does not print anything, although I have several .xcarchive bundles in my ~/Library/Developer/Xcode/Archives folder, and they definitely contain .dSYM sub-bundles whose UUID I can print with dwarfdump --uuid. I also have a couple of .dSYM bundles inside my project's build folder (DerivedData), but none of them are indexed either.

The short and easy question therefore is: How can I tell Spotlight to index my .dSYM bundles?


In case there is no easy answer for this easy question, here is what I have already tried on MB1:

  • Check permissions of files and folders in ~/Library/Developer/Xcode/Archives (they are all OK, 755 for folders, 644 for files)
  • Run mdimport ~/Library/Developer/Xcode/Archives (has no effect)
  • In "System Preferences > Spotlight > Privacy" first add and then remove the ~/Library/Developer/Xcode/Archives folder (has no effect either)
  • Check with mdutil -s / that indexing is enabled for the volume (it is)
  • Erase and rebuild the entire index mdutil -E / (takes maybe 10-15 minutes, but still has no effect)

To go into more detail: I have an older MacBook (let's call this machine MB2) that was my dev machine before I switched to MB1. On MB2 I never had any trouble with symbolicating. MB2 had Mac OS X 10.8 installed while I was still actively developing on it, but I recently upgraded MB2 to Mac OS X 10.9.

Today, running mdfind on MB2 still gives me a lot of .dSYM bundles, both from the Archives folder and from the project's DerivedData build folder. These are all old files from the Mac OS X 10.8 days, but apparently Spotlight keeps its index across OS upgrades. I thought it would be interesting to see how Spotlight behaves when new files are created, so I did the following:

  1. Fire up Xcode on MB2, create a new archive, and run mdfind. This finds the intermediate .dSYM bundle inside the DerivedData build folder.
  2. Delete the intermediate .dSYM bundle and run mdfind again. No results this time, i.e. the .dSYM bundle inside the Archives folder is NOT found!
  3. Make a copy of the .xcarchive bundle created in step 1 and place the copy in the root of the user home directory. Run mdfind. This finds the .dSYM sub-bundle within the copied .xcarchive bundle!

At this point, I jumped to the conclusion that because ~/Library is a hidden folder this is what prevents Spotlight from indexing stuff within it. This can be easily confirmed by creating a regular file inside ~/Library and searching for it (no hits), then moving the file outside of ~/Library and searching again (1 hit). Unfortunately, this theory falls flat on its nose because of two reasons:

  • ~/Library was already hidden in Mac OS X versions prior to 10.9, but this never prevented Spotlight from indexing .dSYM files
  • The "hidden" flag is not all that keeps Spotlight from indexing stuff in ~/Library: If I unhide the folder with chflags nohidden ~/Library, that does not make the regular file visible to Spotlight.

Back to MB1: I tried to repeat step 3 from above, i.e. make a copy of the .xcarchive bundle in the root of the user's home directory, then run mdfind. Surprisingly, on MB1, the result is different from MB2: mdfind still finds no .dSYM bundles whatsoever!


At this point I give up and hope for your help. My conclusion is that Mac OS X 10.9 is somehow responsible for my problems, but for the life of me I can't figure out why this is so. In case it helps, here are a few additional configuration details:

  • MB1:已安装Xcode 5.0.2和Xcode 4.6,默认为5.0.2(使用设置xcode-select)。还安装了Homebrew。该系统是Mac OS X 10.9的全新安装。
  • MB2:已安装Xcode 4.5、4.6和5.0,默认值为4.6。还安装了MacPorts。该系统是Mac OS X 10.9的升级安装(先前已安装。
Herzbube

深入了解Xcode应用程序捆绑包,可以发现以下Spotlight导入程序:

caradhras:~ --> find /Applications/Xcode-5.0.2.app -name \*.mdimporter
/Applications/Xcode-5.0.2.app/Contents/Applications/Application Loader.app/Contents/Library/Spotlight/MZSpotlight.mdimporter
/Applications/Xcode-5.0.2.app/Contents/Library/Spotlight/uuid.mdimporter

运行此命令

mdimport -g /Applications/Xcode-5.0.2.app/Contents/Library/Spotlight/uuid.mdimporter ~

最终索引.xcarchive用户主目录根目录中分发包。但是,即使我明确指向此文件夹它也不会索引束中的束~/Library/Developer/Xcode/Archivesmdimport

问题仍然存在:为什么uuid.mdimporter不自动运行?


编辑

The solution was to reboot the machine (logout/login might have been sufficient), archive bundles outside of ~/Library are now properly indexed. The reason why I needed to reboot probably is this:

  • I am using a privileged admin user (A) for installing software, but I am using a different, non-privileged user (U) for normal work, such as developing with Xcode.
  • I was logged in with user U at the time I installed Xcode with user A
  • Since that time I have never rebooted, nor made any logins (I prefer sending my machine to sleep over night instead of shutting it down). Presumably, the list of active Spotlight importers is updated (probably by launch services) only when logging out/logging in, or after a reboot.

Anyway, during troubleshooting I found that you can check the list of active Spotlight importers by running mdimport -L (note that different users can have different Spotlight importers active at the same time). Unsurprisingly, after the reboot uuid.mdimporter is now listed, while before the reboot it was not.

Here is a useful Apple document that I found after some googling: Troubleshooting Spotlight Importers.


FINAL SOLUTION

Configure Xcode so that the archive folder is located outside of ~/Library. In Xcode 6 you can do this in the Preferences dialog, under the "Locations" tab.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

How can I tell if a hard drive will fit my laptop?

来自分类Dev

How can I tell if a hard drive will fit my laptop?

来自分类Dev

如何告诉Spotlight为我的.dSYM束编制索引?

来自分类Dev

In F#, how do I tell if an object is an Async<_>, and how can I cast it to an Async<_>?

来自分类Dev

How can I tell if an UUID generated by QUuid::createUuid() is based on entrophy of cryptographic quality?

来自分类Dev

How can I use the multidimensional index returned by max or min?

来自分类Dev

How can I cache/memoize my SQLAlchemy functions?

来自分类Dev

How can I use oh-my-zsh with PHPStorm?

来自分类Dev

How can I loop through values in my json file?

来自分类Dev

Sensitivity analysis with R: How can I make my own plot

来自分类Dev

How can I loop through my array in reverse order?

来自分类Dev

How can I reduce the size of my git repo?

来自分类Dev

How can I show the size of all files in my ~/.cache directory?

来自分类Dev

How can I automatically silence my computer at night?

来自分类Dev

How can I find my browser web log file?

来自分类Dev

If i know how a traced output looks, how can i begin creating my function? (Scheme)

来自分类Dev

How can we prevent that when I resize my window, my images move using HTML-CSS?

来自分类Dev

How can I display the data from my Firebase Database in my web site?

来自分类Dev

How do I tell if an XMLHttpRequest failed due to a network issue?

来自分类Dev

In C#, how can I keep all my items in a listbox from changing to the color I set last?

来自分类Dev

Can I get the tab index that was selected before

来自分类Dev

How can I add more button on my Android application which already includes a scrollview?

来自分类Dev

Mapping between DTO and domain objects, how can I make the process transparent to my repository?

来自分类Dev

How can I "group" multiple rows into a collection in my PL/SQL cursor?

来自分类Dev

Mercurial: How can a I make a snapshot of my working directory without doing a changeset?

来自分类Dev

How can I add imported jar files to web-inf/lib in eclipse for my build?

来自分类Dev

How can I improve the efficiency and/or performance of my relatively simple Java counting method?

来自分类Dev

How can I import a model object file into my watch extension if it has a lot of dependencies

来自分类Dev

How can I programatically determine where my C++ runtime libraries are?

Related 相关文章

  1. 1

    How can I tell if a hard drive will fit my laptop?

  2. 2

    How can I tell if a hard drive will fit my laptop?

  3. 3

    如何告诉Spotlight为我的.dSYM束编制索引?

  4. 4

    In F#, how do I tell if an object is an Async<_>, and how can I cast it to an Async<_>?

  5. 5

    How can I tell if an UUID generated by QUuid::createUuid() is based on entrophy of cryptographic quality?

  6. 6

    How can I use the multidimensional index returned by max or min?

  7. 7

    How can I cache/memoize my SQLAlchemy functions?

  8. 8

    How can I use oh-my-zsh with PHPStorm?

  9. 9

    How can I loop through values in my json file?

  10. 10

    Sensitivity analysis with R: How can I make my own plot

  11. 11

    How can I loop through my array in reverse order?

  12. 12

    How can I reduce the size of my git repo?

  13. 13

    How can I show the size of all files in my ~/.cache directory?

  14. 14

    How can I automatically silence my computer at night?

  15. 15

    How can I find my browser web log file?

  16. 16

    If i know how a traced output looks, how can i begin creating my function? (Scheme)

  17. 17

    How can we prevent that when I resize my window, my images move using HTML-CSS?

  18. 18

    How can I display the data from my Firebase Database in my web site?

  19. 19

    How do I tell if an XMLHttpRequest failed due to a network issue?

  20. 20

    In C#, how can I keep all my items in a listbox from changing to the color I set last?

  21. 21

    Can I get the tab index that was selected before

  22. 22

    How can I add more button on my Android application which already includes a scrollview?

  23. 23

    Mapping between DTO and domain objects, how can I make the process transparent to my repository?

  24. 24

    How can I "group" multiple rows into a collection in my PL/SQL cursor?

  25. 25

    Mercurial: How can a I make a snapshot of my working directory without doing a changeset?

  26. 26

    How can I add imported jar files to web-inf/lib in eclipse for my build?

  27. 27

    How can I improve the efficiency and/or performance of my relatively simple Java counting method?

  28. 28

    How can I import a model object file into my watch extension if it has a lot of dependencies

  29. 29

    How can I programatically determine where my C++ runtime libraries are?

热门标签

归档