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

Xcode构建C语言控制台应用报错:the platform is not currently connected

解决Xcode中“the platform is not currently connected”报错的方案

基础排查步骤

  • 确认运行目标:检查Xcode顶部工具栏的运行目标,确保选择的是当前Mac(如“Mac”或“Mac(Rosetta)”),而非iOS模拟器、iPad模拟器等其他平台。
  • 重启环境:关闭Xcode及相关进程,重启Mac后重新打开项目尝试运行。
  • 清理缓存:按下Command + Shift + K清理构建文件夹,再按Command + Option + Shift + K彻底清理缓存,之后重新构建项目。

进阶修复操作

  • 重置Xcode调试配置:打开终端,执行以下命令删除Xcode配置文件和缓存,之后重启Xcode:
    rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
    rm -rf ~/Library/Developer/Xcode/DerivedData
    rm -rf ~/Library/Caches/com.apple.dt.Xcode
    
  • 检查项目构建设置:
    1. 选中项目,进入「Build Settings」标签页。
    2. 搜索「Base SDK」,确保设置为对应系统版本的“macOS”。
    3. 搜索「Deployment Target」,确认目标版本不高于当前Mac系统版本。
  • 验证Xcode完整性:通过App Store检查Xcode更新,或卸载后重新安装最新版本。

Apple Silicon芯片Mac特殊处理

  • 启用Rosetta运行Xcode:右键点击Xcode图标,选择「显示简介」,勾选「使用Rosetta打开」,重启Xcode后重试。
  • 调整项目架构:在Build Settings中搜索「Architectures」,设置为「Standard Architectures (Apple Silicon, Intel)」或匹配当前芯片的架构。

报错信息回顾:

Could not launch “teszt”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: the platform is not currently connected
User Info: {
    DVTErrorCreationDateKey = "2022-11-02 18:46:50 +0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "the platform is not currently connected";
}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.14 07:20:53