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

Xcode 15命令行构建iOS模拟器时忽略-destination参数问题求助

Xcode 15命令行构建iOS模拟器时忽略-destination参数问题求助

各位开发者同仁,我最近遇到一个Xcode 15的命令行构建问题,折腾好久没解决,来这儿求助大家!

之前用Xcode 14的时候,这条构建模拟器的命令完全没问题:

xcodebuild \
-project MyProject.xcodeproj \
-scheme App \
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath ../../derivedData \
clean build

但升级到Xcode 15之后,执行这条命令就报这个错误:

MyProject.xcodeproj: error: "App" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'App' from project 'MyProject')

这个错误明显不对啊!我确实没配置签名配置文件,但模拟器构建根本不需要这个啊!而且更奇怪的是,用Xcode 15的GUI界面直接构建模拟器版本完全正常,一点问题都没有。

我仔细看了命令执行的输出,发现报错前有这么个警告,感觉Xcode 15的xcodebuild完全忽略了我指定的-destination参数:

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006000-0008316802D8801E }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
...
{ platform:iOS Simulator, id:5575F133-1565-4864-882C-78E3EA80F618, OS:17.0, name:iPhone 14 }

明明我要的iPhone 14模拟器就在这个列表里,为什么xcodebuild会匹配不到,反而去选了第一个macOS的目标呢?有没有朋友遇到过类似的问题,或者知道怎么解决吗?

备注:内容来源于stack exchange,提问作者Max

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.20 08:08:10