Solvednativescript cli TNS doctor doesn't recognize Xcode (High Sierra)

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

None of the provided solutions worked

Tell us about the problem

When running tns doctor I get the following warning, even though Xcode is installed:

WARNING: Xcode is not installed or is not configured properly.
You will not be able to build your projects for iOS or run them in the iOS Simulator.
To be able to build for iOS and run apps in the native emulator, verify that you have installed Xcode.

When trying to run the setup script, after confirming that I have Xcode installed, I get the following error:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Xcode is not installed or not configured properly. Download, install, set it up and run this script again.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.1
    (No other information as there's no project yet)

Please tell us how to recreate the issue in as much detail as possible.

I'm on High Sierra with Xcode 9.0.1 (both are the latest versions to this date). I've followed the official guide: https://docs.nativescript.org/angular/start/ns-setup-os-x

After running tns doctor I get the warnings as described above.

22 Answers

✔️Accepted Answer

HI @philipfeldmann

Can yhou please run xcodebuild -version and paste the output?

May be Xcode is installed, but build tools are not.
If that is the case you can set them via xcode-select command or via UI of Xcode (Preferences -> Locations -> Command Line Tools).

Other Answers:

try run this line:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

This line worked for me
sudo xcode-select --reset

That solved my issue, thanks for your fast answer, the support you guys offer is great.
Maybe it'd be a good idea to add this to the docs or the troubleshooting.
Anyway thank you, much love.

I faced the same problem and setting up the command line tools within XCode fixed it. Thanks a lot!
Maybe you could add this hint to the installation instructions on the documentation site?

More Issues: