2015-02-10 198 views
2

我嘗試從developer.apple.com和應用商店安裝XCode 6.1.1。我也嘗試安裝開發者工具developer.apple.com。Xcode已安裝,但我無法使用xcode-select「xcode-select:command not found」

無論哪種方式,出於某種原因它不安裝xcode-select

xcode-select --install 
-bash: xcode-select: command not found 

我確信它可以在看到/usr/binPATH變量

k$ echo $PATH 
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/System/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin:/Users/k/.rvm/bin:/Users/k/.rvm/bin 

但事實證明xcode-select不是在bin文件夾:

k$ ls /usr/bin/x* 
/usr/bin/xar    /usr/bin/xgettext5.18.pl /usr/bin/xpath5.18 
/usr/bin/xargs   /usr/bin/xip    /usr/bin/xslt-config 
/usr/bin/xattr   /usr/bin/xjc    /usr/bin/xsltproc 
/usr/bin/xattr-2.6  /usr/bin/xml2-config  /usr/bin/xsubpp 
/usr/bin/xattr-2.7  /usr/bin/xml2man   /usr/bin/xsubpp5.16 
/usr/bin/xcrun   /usr/bin/xmlcatalog  /usr/bin/xsubpp5.18 
/usr/bin/xed    /usr/bin/xmllint   /usr/bin/xxd 
/usr/bin/xgettext.pl  /usr/bin/xpath 
/usr/bin/xgettext5.16.pl /usr/bin/xpath5.16 

甚至在我的系統在所有:

k$ sudo find/| grep xcode-select 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/share/man/man1/xcode-select.1 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man/man1/xcode-select.1 
find: /dev/fd/3: Not a directory 
find: /dev/fd/4: Not a directory 
/Users/k/.Trash/Xcode 00-40-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/share/man/man1/xcode-select.1 
/Users/k/.Trash/Xcode 00-40-10.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man/man1/xcode-select.1 
/Users/k/.Trash/Xcode 21-31-08-775.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/share/man/man1/xcode-select.1 
/Users/k/.Trash/Xcode 21-31-08-775.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man/man1/xcode-select.1 
/Users/k/.Trash/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/share/man/man1/xcode-select.1 
/Users/k/.Trash/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/share/man/man1/xcode-select.1/usr/share/man/man1/xcode-select.1 

我該怎麼辦?

其他Xcode的信息: 點擊「接受條件」的第一個實例打開Xcode掛起,所以我不得不強制退出它。 Xcode現在會打開,但如果我嘗試去首選項的「位置」部分,則會掛起。以下是我在第一次打開Xcode期間從控制檯獲取的錯誤列表,並轉至首選項的「位置」部分 http://i.stack.imgur.com/YyMgR.png

感謝您的幫助!

+0

我會去到你的'Applications'文件夾並拖動'XCode'進了垃圾箱,清空回收站,重啓並返回到AppStore並再次下載。 – 2015-02-10 21:29:07

+0

試過,沒有運氣。也刪除庫中的開發人員文件夾。不幸的是不幸運 – 2015-02-11 20:28:50

回答

2

我通過手動添加文件/usr/bin/xcode-select解決了這個問題,該文件顯然非常小。

$ echo -e '#!/bin/sh\nexec"[email protected]"' > /usr/bin/xcode-select 
$ sudo chmod +x /usr/bin/xcode-select 
0

在終端

$ DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/" 

$ export DEVELOPER_DIR 
1

接受的解決方案並沒有爲我的工作只是運行下面的命令,所以我想分享在這種情況下,它可以幫助別人。手動安裝命令行工具後,這條線做的伎倆(xcode-select是我/usr/bin/文件夾):

sudo xcode-select --switch/
相關問題