You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 15打包Unity项目报错:无法检测到兼容的iPhoneOS SDK

问题描述

使用Unity 2023.1.9f1导出项目后,通过Xcode 15归档打包时反复触发构建错误,错误提示如下:

Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select.
It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements.
 
More information and installation instructions can be found here:
https://developer.apple.com/support/xcode/
 
Specific Xcode versions can be downloaded here:
https://developer.apple.com/download/more/
 
Unable to detect any compatible iPhoneOS SDK!

已确认未使用CocoaPods或Flutter,仅通过Xcode操作,且已在Xcode下拉菜单中选择CommandLineTools、通过Xcode主菜单安装SDK,但问题仍未解决。

可能的原因及解决办法
  • 检查Xcode的安装路径与命名规范
    必须保证Xcode.app安装在/Applications目录下,且文件名符合Xcode*.app格式(推荐使用默认的Xcode.app,不要自定义命名为Xcode15.app这类特殊名称)。如果路径或命名不符合要求,移动或重命名后重启Xcode。

  • 重新指定xcode-select的路径
    打开终端,先查看当前xcode-select指向的路径:

    xcode-select -p
    

    如果返回的不是/Applications/Xcode.app/Contents/Developer,执行以下命令重新指定(需要输入系统密码):

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

    完成后重启Xcode,再尝试构建归档。

  • 验证iPhoneOS SDK是否存在
    打开Finder,前往路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs,检查是否存在iPhoneOS.sdk相关文件(Xcode 15对应应为iPhoneOS17.0.sdk或更高版本)。如果缺失,打开Xcode的设置→平台,找到iOS选项点击「安装」重新下载SDK,安装完成后重启Xcode。

  • 核对Unity导出的SDK配置
    在Unity的Build Settings中,切换到iOS平台,确认SDK版本设置为「Latest installed」,避免选择Xcode未安装的旧版SDK。设置完成后重新导出项目,再用Xcode打开尝试归档。

  • 清理Xcode缓存
    关闭Xcode,执行终端命令清理DerivedData缓存:

    rm -rf ~/Library/Developer/Xcode/DerivedData
    

    重新打开Xcode后,按下Command+Shift+K清理项目,再尝试归档操作。

内容的提问来源于stack exchange,提问作者Solar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 12:05:54