tccd stuck and taking up lots of cpu

Often when I am using XCode (and sometimes other apps) the tccd process will take up lots of CPU or just get stuck. I find myself more and more having to kill that process (now it happens multiple times a day). It always seems to immediately re-start the process as soon as it is killed.

I am wondering if there is a way to fix it so that it does not break all the time.


I found this blog post titled: Fix TCCD process consuming high CPU usage when run Xcode.

excerpt

Using Xcode 8 is really a frustrating experience. When compile swift source files or write code in Sierra(the latest macOS), Xcode frequently freeze. It's nuking productivity. After a long time of searching, I found this is caused by a process named tccd which take up to 70% of CPU usage. What is tccd? It seems to be a access controller that manage the permission to user's contacts. So the solution is quite easy, go to

System Preferences → Security & Privacy → Privacy → Contacts

uncheck Xcode and restart it. Then, it works again.

So it would seem, simply disabling contacts will disable tccd thereby dropping the high CPU load.