2017-07-17 82 views
0

在尝试使用IDE德科,因为我收到以下错误第一次(A为React.js IDE):没有可用的模拟器。请安装Xcode和在iOS模拟器来预览项目

'No simulators available.', 'Please install Xcode and an iOS simulator to preview your project.'

我安装的Xcode。它在文件中:

Macintosh HD < Applications < xcode-beta 

我安装了命令行工具。根据下面的命令行提示,它们位于

/Library/Developer/CommandLineTools 

[redacted] at MacBook-Air-2 in ~ 
$ xcode-select -p 
/Library/Developer/CommandLineTools 
[redacted] at MacBook-Air-2 in ~ 
$ /usr/bin/xcodebuild -version 
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer 
directory '/Library/Developer/CommandLineTools' is a command line tools 
instance 
[redacted] at MacBook-Air-2 in ~ 
$ 

回答

1
  1. 运行Xcode中至少一次,并安装命令行工具
  2. 在控制台类型:

    $ which xcrun 
    // /usr/bin/xcrun 
    

然后键入:

$ xcrun --version 
// xcrun version 33. 

然后键入:

$ xcrun simctl list 
// == Device Types == 

然后:

开放的Xcode(顶部菜单):

Xcode > Preferences > Location

有命令行工具下拉。确保在那里选择了一些东西。

退出您的IDE。重新启动您的IDE。它应该工作。这些是为我工作的步骤。

我在Deco的Slack组中找到了这些指令。将它们放在SO上方便访问。链接到线程:https://decoslack.slack.com/archives/C0NB152SH/p1476392009000521

+0

Xcode>首选项>位置 并选择Xcode命令行工具 这为我工作 –