Terminal slow to start first time due to xcodebuild

Viewed 4615

The first time I run Terminal or start SmartGit either one is slow to start, taking up to ~30 seconds. When I look at the status bar for Terminal I see that it is stuck running some xcodebuild command. Not sure what exactly the command is.

Does anyone know how to view which commands Terminal runs on startup? Or if anyone else had this issue? I think it is related to this question but the slow down is only first the first startup of Terminal and for ~30 seconds. Not the 2-3 seconds users reported. Subsequent runs or commands work normally.

3 Answers

I've tried with sudo xcodebuild -license accept but at start the console is still very slow and, after a reboot, I have to wait at least 15s to see the terminal.

Looking around I found out that somehow it's nvm that needs xcodebuild.

The slowdown was fixed changing the nvm default to system

nvm alias default system

Try xcodebuild -runFirstLaunch

Then after it is complete, open up 2 new Terminal tabs.

Worked for me on macOS 12.6.

I found this solution over here: https://superuser.com/a/1742463/98148

Related