2017-07-17 83 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命令行工具 這爲我工作 –