[Bug]: Dynamically resolve target name in cap run ios
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- ios, typescript
调研方向
从 cli/src/ios/run.ts 中链接的 bundle 路径逻辑开始,然后检查 xcodebuild -scheme -showBuildSettings 如何公开 TARGET_NAME。使用链接的复现项目来验证,当 scheme 名称和 target 名称不同时,deployment 能够解析 target 的 .app 路径。
由索引模型根据 Issue 内容生成。
描述
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0
Installed Dependencies:
@capacitor/cli: 7.2.0
@capacitor/core: 7.2.0
@capacitor/android: 7.2.0
@capacitor/ios: 7.2.0
Other API Details
not relevant
Platforms Affected
- iOS
- Android
- Web
Current Behavior
When running a Capacitor iOS application which has multiple schemes with cap run ios --scheme Dev --configuration Dev the deployment fails with
Deploying Dev.app to 00008101-001525992141001E - failed!
[error] ERR_UNKNOWN: Path
'<project_dir>/ios/DerivedData/<id>/Build/Products/Dev-iphoneos/Dev.app'
not found
as the runIOS function assumes that the .app name matches the scheme name (i.e., ${runScheme}.app). See: ios/run.ts#L59
However, by default this is not always correct, as the .app name is determined by the target name, not the scheme name. This can cause deployment to fail because the .app bundle is not found at the expected path, when the scheme and target names differ.
Expected Behavior
The Capacitor CLI should dynamically query the actual TARGET_NAME associated with the selected scheme using xcodebuild -showBuildSettings, ensuring the correct .app name is used during deployment. This would make runIOS more robust and compatible with a broader range of Xcode project configurations.
Project Reproduction
IsAvaible/cap-run-dynamic-target-name-reproduction
Additional Information
This can be fixed by adding a helper function that invokes:
xcodebuild -scheme <scheme> -showBuildSettings
...and extracts the TARGET_NAME from the output. This resolved name should then be used in place of ${runScheme} when determining the final app bundle path.
This enhancement would:
- Improve compatibility with multi-target/-scheme projects
- Prevent .app not found errors
- Align behavior with actual Xcode project structure
Let me know if you'd like a PR for this :).
- 主要语言
- TypeScript
- 星标
- 17.1k
- 派生
- 1.3k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 26
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ionic-team/capacitor 的其他 Issue
-
triage
难度 2/5 1-3 小时 新手友好度 76/100
ionic-team/capacitor#8759 ·
维护者通常 1 天内回复
-
[Bug]: Plugin call after navigation can be answered before reply proxy is updated可能已有人在做 @MateStrysewske 于 71 天前认领。 未关闭triage
难度 2/5 1-3 小时 新手友好度 84/100
ionic-team/capacitor#8616 ·
维护者通常 1 天内回复
-
help wanted
难度 2/5 1-3 小时 新手友好度 68/100
ionic-team/capacitor#8574 · 3 条评论 ·
维护者通常 1 天内回复
-
SystemBars: safe area CSS injection throws "Cannot read properties of null" on startup (Android 16)可能已有人在做 @kttalley 于 62 天前认领。 未关闭triage
难度 2/5 1-3 小时 新手友好度 78/100
ionic-team/capacitor#8530 · 2 条评论 ·
维护者通常 1 天内回复
-
fix(android): remove unchecked Java compilation warnings可能已有人在做 @Ajamuar 于 15 天前认领。 未关闭triage
难度 2/5 1-3 小时 新手友好度 78/100
ionic-team/capacitor#8529 · 1 条评论 ·
维护者通常 1 天内回复
查看 ionic-team/capacitor 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
prio:low scope:world
难度 2/5 1-3 小时 新手友好度 83/100
OliverRomhagen/vrigstad-joyride#849 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
genfeedai/genfeed.ai#11916 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
erkamyaman/rust-anything#1153 ·
维护者通常 1 天内回复
-
The Phase 5 report says 0.3.0 waits for the live check可能已有人在做 @fzn0x 今天认领。 未关闭documentation
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复