How to fix Xcode indexing endless problem (a different way)

Kittisak Phetrungnapha
iTopStory
Published in
2 min readDec 21, 2017

Hi everyone, I am a hundred percent sure that every iOS developer used to face the Xcode indexing endless problem. I bet you before you read this short article you will say

Just clear derive data folder, clean, and rebuild project again. Then everything is working fine. Easyyyyyy

Recently, I found the problem and thought like the above statements. Unfortunately, It did not work! The Xcode still was indexing. My laptop was getting hot, noisy sound came from the fan, The operation was not smooth anymore. Then I opened Activity Monitor and found that the CPU was getting up to 90% especially swift processor thread. OSX automatically killed other apps e.g. Line, Stack, Safari and remain only Xcode, and Finder (Dafug?) Eventually, My laptop was hang and had to force restart several times.

I even try to delete the project, clone from git, install CocoaPods and Carthage , run pod install, carthage bootstrap then open the project and was waiting Xcode to index from scratch again. Sadly, The problem was not gone. Hopelesssss 😔

When I was being hopeless, my boss came to me and help to figure out the problem. He tried every way that I had already tried. Same way same result.

However, he said some interesting thing like this

If the problem is about indexing files in Xcode project, why not try to copy derive data (just the same project) from your partner laptop into yours?

So, I did it and It worked. I don’t know what is the root cause problem and don’t know why just copy derive data can solve the problem. But it’s OK. I can continue my work. 😂

Finally, if you face a problem like this, try to

Copy derive data (Just your project, Not whole) from other laptops that used to build and index successfully into your derive data folder.

This might save your life from putting your head into the desk. 😊

Thank you for reading. See ya again next time in Thai or English article.

--

--

Kittisak Phetrungnapha
iTopStory

I am a software engineer who fall in love to code, read, and write. :) itopstory.com