xcodebuild firing after every terminal command

After every terminal command, the prompt becomes unresponsive for 2-3 seconds. During this time xcodebuild seems to be running:

xcodebuild is here

Where would this hook be that's causing the xcodebuild to be fired? I couldn't find anything in my .zshrc.


Solution 1:

The problem is that the Xcode license hasn't been accepted so when running git it tries to prompt you for accepting the license. For me running

sudo xcodebuild -license accept

fixed the issue

Solution 2:

In my case, the problem had something to do with Apple's version of Git. I'm using zsh and include the current git branch in my command line, so git runs every time a new command prompt is generated. When I switched over to using Homebrew's version of Git

brew install git

and opened a new terminal, the problem went away. I'm not sure why Apple's version of git was causing xcodebuild to run every time. This was the bug that helped me figure it out: https://github.com/robbyrussell/oh-my-zsh/issues/2189

Solution 3:

According to this blog zsh reads a whole bunch of files on startup (including .profile):

enter image description here

So make sure to check all of them (and also any additional files sourced/called from there).