Nativescript无法识别Xcode(High Sierra)

23

我使用的是 Xcode 版本 9.0.1 (9A1004),操作系统为 High Sierra。 在运行 tns doctor 命令时,我收到了如下警告:

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.
如果我运行安装脚本,还会得到以下内容:
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.

你可能已经猜到,我从应用商店安装了Xcode,并且还安装了CocoaPods和xcodeproj。这是我收到的唯一警告。

有什么建议吗?

3个回答

62

5
感谢DuckDuckGo搜索引擎帮我找到这个答案。 - Kyle Hayes
1
也适用于Mojave。 - grizzb
Super. 工作在 Nativescript 上。 - Sacky San

2

今天我遇到了这个问题,但是运行推荐的命令没有帮助。我发现运行以下命令:

$ tns doctor

会引导我完成一系列提示并纠正该问题。在程序完成后,我需要重新启动终端才能生效。


1
打开Xcode,然后转到偏好设置 -> 位置 -> 命令行工具,之后它会自动选择相同的路径。系统可能会要求输入sudo密码。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接