Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop iTerm2 from running xcodebuild and hanging when I open a window?

Since this morning, on my iMac (macOS High Sierra Version 10.13.6) any time I open an iTerm2 window (with Oh My Zsh installed), I see this:

iTerm2 window running xcodebuild and stuck

It seems that it's trying to run xcodebuild and it's stuck. I never get a prompt, even after waiting a long time. I've tried pressing ctrl+C to end the process, and then I see this:

iTerm2 window after pressing cmd+C

I'm not purposely trying to do anything with Xcode. I just want to use the command line. I've been working for months without this problem, and it just started today. Any suggestion for how I can resolve this and use iTerm like normal?

like image 788
Paul Shryock Avatar asked Sep 20 '18 14:09

Paul Shryock


3 Answers

I had the similar issue. This resolved the problem:

 # sudo xcodebuild -license accept
like image 144
Weijian Avatar answered Sep 29 '22 13:09

Weijian


I got the same issue with macOS Big Sur.

Tried all Google results and nothing works. Eventually, I found it was caused by setting Node.js v8.x as default in nvm, alias default to system will resolve the issue. Although I don't know why nvm need to run xcodebuild for Node.js v8.x.

like image 20
Rainux Avatar answered Sep 29 '22 12:09

Rainux


I have got the same issue after updating my MBP16 with Big Sur today

I have checked my xcode command tools path with xcode-select -p and I found that the path was related to an older version of xcode (10.1 in my case, I do not remember the path, maybe /Applications/Xcode_10.1.app/Contents/Developer/).

I have reinstall xcode command tools (sudo rm -rf /Library/Developer/CommandLineTools and xcode-select --install) and I have switched the xcode command tools path with this command sudo xcode-select -switch /Library/Developer/CommandLineTools

The issue is resolved now

like image 42
King Julian Avatar answered Sep 29 '22 11:09

King Julian