Matt McClure
Matt McClure

Reputation: 16347

How can I exclude some files from Xcode's indexing?

I have an iOS project with 5600 files in the source code repository. Xcode appears to visit all of those files during its indexing. Some of the files are large images that I can see no benefit to indexing. How can I tell Xcode to exclude those files so that indexing will go faster?

I'm aware of several other questions and answers that describe how to disable indexing entirely, but I didn't find any that address how to keep indexing enabled and tell Xcode how to skip irrelevant files.

Upvotes: 10

Views: 1926

Answers (2)

sunkehappy
sunkehappy

Reputation: 9101

justin's answer is good if you really need to create one or more separate targets. And I've searched but find you can enable/disable the indexing. I've not find anyway to exclude some kind of file when indexing. And you don't let Xcode index, you will lose some feature like autocomplete(Even for images, you can see the image name autocomplete in InterfaceBuilder).

If you are really sure you want to disable indexing. Use this in terminal:

defaults write com.apple.dt.XCode IDEIndexDisable 1

When you want indexing back:

defaults delete com.apple.dt.XCode IDEIndexEnable
defaults write com.apple.dt.XCode IDEIndexDisable 1

Another related article on How to make Xcode faster by solving Xcode slow issues with xcode 4.x

Upvotes: 0

justin
justin

Reputation: 104698

One roundabout approach: Create one or more separate targets, and simply link to the object file(s) they produce.

Upvotes: 1

Related Questions