上一篇文章說到安裝homebrew,這篇文章就說用homebrew安裝Carthage遇到的坑。注意:這篇文章針對的工程是iSimulator, 安裝homebrew和Carthage都是為了跑起這個工程。
1.介紹
Carthage與CocoaPods類似,都是用于在iOS/OS X環(huán)境下管理第三方的工具。
2.安裝Carthage
brew install carthage
安裝Carthage之后, 可以通過下面命令查看版本
carthage version // 目前的版本號為0.32.0
3. 使用Carthage
進入項目所在的文件夾
cd ~/路徑/項目文件夾
因為本身我的工程里就有個Cartfile文件,別人已經(jīng)創(chuàng)建好
./carthageBootstrap.sh
運行之后提示這個錯誤
A shell task (/usr/bin/xcrun xcodebuild -project /Users/Corporal/Desktop/iSimulator-develop/Carthage/Checkouts/FBSimulatorControl/FBSimulatorControl.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
想到我的電腦有兩個Xcode, Xcode重命名后,xcodebuild找不到原來的Xcode了所致。
解決方法:在 終端執(zhí)行如下命令
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
再次執(zhí)行./carthageBootstrap.sh, 成功

4.運行iSimulator
折騰半天終于將工程跑成功,但運行完之后控制臺提示這個錯誤, 然后模擬器沒有顯示出來
Unable to load Info.plist exceptions (eGPUOverrides)
iSimulator[12766:646940] [default] Unable to load Info.plist exceptions (eGPUOverrides)
環(huán)境:Mac系統(tǒng)是mojave10.14, Xcode10
更新到最新的Xcode10.1還是報同樣的錯,更新到10.14.3中,希望是系統(tǒng)的問題了
18/3/2 18:47編輯
將Mac的系統(tǒng)升到10.14.3運行工程就沒有問題了, 雖然也是提示上面這段話, 但模擬器可以跑起來
附
下面貼幾個Carthage的使用方法
Carthage的用法及注意事項
Carthage使用教程總結(jié) - iOS
Carthage的安裝和使用
參考鏈接
1.xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
2.xcode-select: error: tool 'xcodebuild' requires Xcode錯誤解決方法
3.無法在macOS 10.14 Mojave下加載Info.plist錯誤Xcode 10
4.Window not drawn on startup using Xcode10