[英]How do I determine which iOS SDK I have?
我確定這很簡單,但是如何確定我當前安裝的 iOS SDK 版本?
如果你輸入這個:
$> xcodebuild -showsdks
它給出了這樣的東西:
$> OS X SDKs:
OS X 10.8 -sdk macosx10.8
OS X 10.9 -sdk macosx10.9
iOS SDKs:
iOS 6.1 -sdk iphoneos6.1
iOS 7.0 -sdk iphoneos7.0
iOS Simulator SDKs:
Simulator - iOS 6.0 -sdk iphonesimulator6.0
Simulator - iOS 6.1 -sdk iphonesimulator6.1
Simulator - iOS 7.0 -sdk iphonesimulator7.0
如果您關心內部版本號(如“10B61”),尤其是在測試版期間,檢查您安裝的 Xcode 和相關 SDK 版本的最佳位置是使用“系統信息”。
Apple 菜單 > 關於本機 > 系統報告 > 軟件 > 開發人員
在那里,您將看到開發人員工具的所有主要組件的版本號和內部版本號。 頂級版本和內部版本號對應於您從 Apple 下載的磁盤映像的名稱。
這是從 macOS 10.14.3 開始的。
對於最新版本的 MAC OS Mountain Lion:
Apple Menu > About this Mac > More Info... > System Report... > Software > Developer
您會找到這樣的開發者信息:
版本:4.6 (4H127) 位置:/Applications/Xcode.app 應用程序:Xcode:4.6 (2066) Instruments:4.6 (46000) SDKs:OS X:10.7:(11E52) 10.8:(12C37) iOS:6.1:(10B141) iOS模擬器:6.1:(10B141)
更新:感謝 Stan 展示了如何在 Lion 上使用 Xcode 4.3:
ls /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
以下命令顯示了您計算機上安裝的所有 iPhone SDK 的列表。
ls /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
我發現的最簡單的原因是運行此命令行:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
或者,如果您有多個XCode版本:
sudo xcode-select -switch /Applications/Xcode<version_number>.app/Contents/Developer
fastlane無法成功執行該命令,因此聽起來您沒有為xcodebuild
選擇 Xcode 版本來運行它。 運行上面的xcode-select
命令應該可以為您解決問題;)
從桌面:實用程序/系統信息/軟件/開發人員 -- 列出已安裝的 SDK
xcode-select --print-path #print your current path Probably this path
/Library/Developer/CommandLineTools
sudo xcode-select --reset #reset to the default command line tools path
xcode-select --print-path# the default should this path
/Applications/Xcode.app/Contents/Developer
xcrun -sdk iphonesimulator --show-sdk-path #the path: /usr/bin/xcrun
#should to print the num of iPhoneSimulator:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator{num}.sdk
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.