Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nativescript doesn't recognize Xcode (High Sierra)

I'm on High Sierra with Xcode Version 9.0.1 (9A1004). When running tns doctor I get the following warning:

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.

If I run the installation script, furthermore I get:

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.

As you might have guessed, I have Xcode installed from the app store and I've also installed cocoapods and xcodeproj. This is the only warning that I get.

Any suggestions?

like image 711
Philip Feldmann Avatar asked Oct 21 '17 10:10

Philip Feldmann


3 Answers

Run the following command:

sudo xcode-select --reset

I found this answer here:

http://overengineer.net/fixing-nativescript-s-xcode-is-not-installed-or-is-not-configured-properly-on-macos

like image 111
dabinsi Avatar answered Nov 08 '22 02:11

dabinsi


I had this problem today, but running the recommended command didn't help. I found that running the command

$ tns doctor

walked me through a series of prompts and corrected the issue. I did have to restart my terminal after the program completed in order for it to take effect.

like image 37
GrokSrc Avatar answered Nov 08 '22 02:11

GrokSrc


Open Xcode than go to Preferences -> Locations -> Command Line Tools after that it'll automatically take a path for the same. The system may ask for sudo password.

like image 31
ixhimanshu Avatar answered Nov 08 '22 01:11

ixhimanshu