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.

3 Answers 3


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

  • 1
    The was exactly happened to me after a new installation of xcode!
    – padfoot
    Commented Jan 24, 2020 at 8:37

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

  • I did this, took an eternity because homebrew decided to update a bunch of formulas, and unfortunately it didn't fix the problem.
    – stevec
    Commented Jan 18, 2022 at 2:02

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).

  • @patrix : much obliged... that is much nicer. Thx :)
    – chillin
    Commented May 11, 2014 at 21:42
  • This chart is amazing, I can't believe I've never seen it until now. Thank you!
    – Matt
    Commented Jul 24, 2021 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .