运行iSimulator工程

上一篇文章说到安装homebrew,这篇文章就说用homebrew安装Carthage遇到的坑。注意:这篇文章针对的工程是iSimulator, 安装homebrew和Carthage都是为了跑起这个工程。

1.介绍

Carthage与CocoaPods类似,都是用于在iOS/OS X环境下管理第三方的工具。

2.安装Carthage

brew install carthage

安装Carthage之后, 可以通过下面命令查看版本

carthage version  // 目前的版本号为0.32.0

3. 使用Carthage

进入项目所在的文件夹

cd ~/路径/项目文件夹

因为本身我的工程里就有个Cartfile文件,别人已经创建好

./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了所致。

解决方法:在 终端执行如下命令

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/

再次执行./carthageBootstrap.sh, 成功


image.png

4.运行iSimulator

折腾半天终于将工程跑成功,但运行完之后控制台提示这个错误, 然后模拟器没有显示出来
Unable to load Info.plist exceptions (eGPUOverrides)

iSimulator[12766:646940] [default] Unable to load Info.plist exceptions (eGPUOverrides)

环境:Mac系统是mojave10.14, Xcode10
更新到最新的Xcode10.1还是报同样的错,更新到10.14.3中,希望是系统的问题了

18/3/2 18:47编辑
将Mac的系统升到10.14.3运行工程就没有问题了, 虽然也是提示上面这段话, 但模拟器可以跑起来

下面贴几个Carthage的使用方法
Carthage的用法及注意事项
Carthage使用教程总结 - 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

你可能感兴趣的:(运行iSimulator工程)