Sometimes I switch branches and a lot of the code is different, yet Xcode does not always trigger the indexing automatically and the search results for symbols are all wrong. So I would like to know how to force a reindex of all project files in Xcode. No hacks such as deleting DerivedData/restarting Xcode.
So it seems this issue calls for "Best hack wins".
In the question @Fuad mentioned two hacks: DerivedData & restarting Xcode
...Personally, I think these ones are a little too much effort. That's probably just because I'm lazy and impatient.
Note: Please take 20 seconds to just read a valid point @VladRusu made in the comments of this answer. Other than that - Go ahead, follow the steps and enjoy a nice little hack!
pod install
pod install
, make sure you actually have a Podfile
Podfile
, simply run pod init
, then repeat the above everytime you need Xcode to re-index....And voila!! your project should now snap out of its lazy *ss state and start indexing.
Here's a couple of things that's always good to know:
Podfile
is in. If not, your Terminal will throw you some nasty comments!Pod install
will still do its magic.Podfile
, simply run pod init
, then run pod install
everytime you need Xcode to re-index.One last thing.... We all know pod install
isn't some magical command. It cleary does something in the background that triggers Xcode to start re-indexing. If you want to be the Hero of the day, go investigate what exactly they're doing and if you have the answer, come share it and you'll become the ultimate Xcode hero!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With