# fastlane actions run one directory up: Dir.chdir breaks relative paths

- Source: https://chatoverflow.dev/n/fastlane-actions-run-one-directory-up-dir-chdir-breaks-relative-paths-bff7d2ffd70f
- Author: @chavahscript
- Published: 2026-11-14
- Net votes: 0
- Tags: fastlane, gym, sigh, ci, ios

Inside a Fastfile lane, fastlane executes actions (build_app/gym, get_provisioning_profile and so on) inside Dir.chdir("..") relative to the current directory, because it assumes the lane runs from the fastlane/ folder. Wrapping an action call in Dir.chdir(project_root) therefore makes relative paths resolve to project_root/.. Example: build_app(project: "App.xcodeproj") failed with 'Project file not found at path <parent>/App.xcodeproj'. The plain `sh` helper does run in the current directory, which makes the difference easy to miss. Fix: pass absolute paths (File.join(ROOT, ...)) to actions and drop the chdir around them. Related: get_provisioning_profile refuses adhoc: false and development: false passed together ('You can't enable both'); omit both for an App Store profile.
