xcode-select: error: tool 'xcodebuild' requires Xcode错误的解决办法
2016-01-31 10:37
531 查看
在命令行交叉编译iPhone程序的时候
$ xcrun --sdk iPhoneOS --show-sdk-path
xcrun: error: SDK "iPhoneOS" cannot be located
xcrun: error: SDK "iPhoneOS" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iPhoneOS'
根据以前Linux的经验,这个可能是路径不对,然后就进行排查
xcode-select --print-path
/Library/Developer/CommandLineTools
发现这个并不是我的Xcode路径,
$ xcodebuild -showsdks
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
额,果然,提示路径不对,那怎么办呢
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
用这个命令切换到你正在用的Xcode安装路径下。
再来看看
$ xcodebuild -showsdks
2016-01-31 10:24:31.499 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XAlign.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
2016-01-31 10:24:31.500 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
2016-01-31 10:24:31.501 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
2016-01-31 10:24:31.502 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/KSImageNamed.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
OS X SDKs:
OS X 10.11
-sdk macosx10.11
iOS SDKs:
iOS 9.2
-sdk iphoneos9.2
iOS Simulator SDKs:
Simulator - iOS 9.2
-sdk iphonesimulator9.2
tvOS SDKs:
tvOS 9.1
-sdk appletvos9.1
tvOS Simulator SDKs:
Simulator - tvOS 9.1
-sdk appletvsimulator9.1
watchOS SDKs:
watchOS 2.1
-sdk watchos2.1
watchOS Simulator SDKs:
Simulator - watchOS 2.1
-sdk watchsimulator2.1
$ xcrun --sdk iphoneos --show-sdk-path
又可以进行交叉编译了!
为什么会出现这种错误呢,原来是我安装了2个Xcode。所以,安装了多个Xcode的时候,就要注意了
$ xcrun --sdk iPhoneOS --show-sdk-path
xcrun: error: SDK "iPhoneOS" cannot be located
xcrun: error: SDK "iPhoneOS" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iPhoneOS'
根据以前Linux的经验,这个可能是路径不对,然后就进行排查
xcode-select --print-path
/Library/Developer/CommandLineTools
发现这个并不是我的Xcode路径,
$ xcodebuild -showsdks
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
额,果然,提示路径不对,那怎么办呢
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
用这个命令切换到你正在用的Xcode安装路径下。
再来看看
$ xcodebuild -showsdks
2016-01-31 10:24:31.499 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XAlign.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
2016-01-31 10:24:31.500 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
2016-01-31 10:24:31.501 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
2016-01-31 10:24:31.502 xcodebuild[782:29058] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/KSImageNamed.xcplugin'
not present in DVTPlugInCompatibilityUUIDs
OS X SDKs:
OS X 10.11
-sdk macosx10.11
iOS SDKs:
iOS 9.2
-sdk iphoneos9.2
iOS Simulator SDKs:
Simulator - iOS 9.2
-sdk iphonesimulator9.2
tvOS SDKs:
tvOS 9.1
-sdk appletvos9.1
tvOS Simulator SDKs:
Simulator - tvOS 9.1
-sdk appletvsimulator9.1
watchOS SDKs:
watchOS 2.1
-sdk watchos2.1
watchOS Simulator SDKs:
Simulator - watchOS 2.1
-sdk watchsimulator2.1
$ xcrun --sdk iphoneos --show-sdk-path
又可以进行交叉编译了!
为什么会出现这种错误呢,原来是我安装了2个Xcode。所以,安装了多个Xcode的时候,就要注意了
相关文章推荐
- hdu1232 畅通工程 && poj2524 Ubiquitous Religions(并查集裸)
- 消息队列选型[首选Kafka](备选:RabbitMQ/NSQ/RocketMQ/disque/Kafka)
- NGUI各个基本组件总结
- Devexpress VCL Build v2014 vol 15.2.3 发布
- UESTC-888-Absurdistan Roads(kruskal+floyd)
- LeetCode_60 Permutation Sequence
- iOS之UI--辉光动画
- 动画交互设计与技术实现
- UIView上的按钮跳转到一个控制器UIViewController上去
- jfinal2.2+easyui1.4.4后台权限管理系统 [2016.01.31 更新]
- 利用values来反向查询key,有没有简单的方法呢?
- uicollectionview的基本使用
- 网卡解析arp协议导致ip address ** is already in ues for...
- LeetCode 303:Range Sum Query - Immutable
- 集训队专题(2)1004 Queuing
- lintcode: Unique Paths
- Divide and conquer:Showstopper(POJ 3484)
- Implement Queue by Two Stacks
- UISegmentedControl分段控件使用详解
- UISegmentedControl 分段控件-IOS开发