Reputation: 2840
I've been working with xCode 4.5.2, and have noticed that if you are indexing, you need to stop everything and let it do it's job, or else you'll get bogged down. It's become a bit of a problem, as the project is a large one, and indexing has been taking a long time to do, and it will do it constantly. One instance was it indexed the entire project, after I worked a little bit on the project it started to re-index almost 75% of the project. I checked with source control, and there had been no changes to the project in the amount of time I worked on it.
Is there any way to stop the indexing entirely, or reduce the amount of times it indexes? Are there any downsides of turning off indexing? I had read in previous questions where it was said it prevented auto-complete and searching through the project.
Upvotes: 35
Views: 36089
Reputation: 904
Whatever is your reason to want this (mine is "An internal error occurred. Editing functionality may be limited") for Xcode 10.1:
defaults write com.apple.dt.Xcode IDEIndexDisable -bool true
Close Xcode, run this, open Xcode.
Upvotes: 16
Reputation: 3126
If you are working on a large project and generate the xcodeproj with cmake, you will get into problems when you add large binaries into it. If cmake doesn't recognize the extension it tags them as 'sourcecode' by default!
... and those binaries will then be indexed by xcode, meaning your machine is constantly indexing ( and start from scratch each time you regenerate the workspace ). Also find-in-files won't work (it just hangs).
One easy solution is to tag your binaries and tell xcode to ignore them, e.g. like this ( cmake 3.2 and higher, otherwise XCODE_EXPLICIT_FILE_TYPE isn't supported ) :
# fill cmake-variable with some files
file(GLOB MYGAME_BINARIES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "binaries/*")
# tag them as "not-sourcecode" ( maybe there is sth better than 'compiled', but it worked for my purpose)
set_source_files_properties( ${MYGAME_BINARIES} PROPERTIES XCODE_EXPLICIT_FILE_TYPE "compiled" )
Upvotes: 4
Reputation: 4793
Just run this command in the terminal to turn off Indexing:
defaults write com.apple.dt.XCode IDEIndexDisable 1
To turn it back on, run this:
defaults write com.apple.dt.XCode IDEIndexDisable 0
(Note: Apparently you need to delete this key in order for the change to take affect, however, I used simply the above command and it worked fine. So if doing the above doesn't work, try deleting the key)
EDIT
Sorry, missed part of the question. Yes, it will make it so searching does not work as fast. Perhaps auto-complete will get disabled. Indexing is what allows Xcode to quickly remember what you have done. Turning it off will make it slightly harder to work with, but it improves loading time.
Upvotes: 76