来自作者:https://blog.csdn.net/wuming2016/article/details/107889306
1.Unity中导出XCode工程
(1)PlayerSetting-Other Setting中将TargetSDK设置为Simulator SDK。默认是Device SDK,也就是打真机包。
(2)OtherSetting,取消勾选Auto Graphics API,并加上OpenGLES2,3 最好是去掉Metal
如果不做(2)那么不能导出XCode工程
In order to build the Xcode project for SImulator make sure that either GLES2 or GLES3 is added to the 'Graphics APIs' list because currently Metal is not supported in the Simulator
如果在(2)中不去掉Metal是很有可能在模拟器运行起来后闪退,卡在UnityInitApplicationGraphics函数中。
2.XCode中下载模拟器SDK
打开XCode中下载模拟器的窗口XCode->Preferences->Components,选择一个合适的SDK(近期的就可以,不用太新也不用太久),安装后最好重启一下XCode或者Mac。安装过程中没什么需要设置的,就是中途需要你输入你的Mac密码。
3.XCode中添加需要的具体机型的模拟器。
XCode->Windows->Devies and Simulators