VSCode中用rdbg调试Fastlane遇Fastfile找不到问题求解决方案
解决VSCode调试Fastlane找不到源码的问题
最小launch.json配置片段
替换你当前的调试配置为以下内容:
{ "type": "rdbg", "name": "Debug Fastlane", "request": "launch", "script": "/opt/homebrew/bin/bundle", // 可通过终端执行`which bundle`获取实际路径 "args": ["exec", "fastlane", "my_lane"], "cwd": "${workspaceFolder}" }
关键配置说明
- 用bundle作为脚本入口:你命令行里的
bundle exec会让Fastlane在项目专属的Gem环境中运行,直接指定fastlane脚本路径会跳过bundle的环境处理,导致调试器无法定位项目内的Fastfile。 - 指定工作目录:
${workspaceFolder}确保调试器在你的项目根目录(Fastfile所在位置)启动,避免路径匹配错误。 - 确认bundle路径:通过
which bundle命令获取本地bundle的实际路径,替换配置中的对应字段。
额外注意事项
- 保留Fastfile里的
require 'debug'和binding.break代码,无需额外修改。 - 调试前执行
bundle install确保所有依赖已正确安装。 - 检查VSCode的Ruby Debugger (rdbg)插件是否为最新版本。
内容的提问来源于stack exchange,提问作者Sergei Kuzmin
相关产品推荐
相关产品推荐

