![](/img/trans.png)
[英]GitLab Ci Runner error “ bash: line 21: xcodebuild: command not found ”
[英]xcodebuild command fails in Gitlab Runner
我正在我的項目中設置 Gitlab CI, xcodebuild命令在 gitlab-runner 中失敗。 但是,以下清理 Xcode 項目的命令在終端中完美運行
xcodebuild clean -workspace ~/Documents/iOS\ Projects/{ProjectName}.xcworkspace -scheme {ProjectScheme}
當我將此腳本添加到“yml”文件並將其推送到 repo 時,gitlab 作業說, xcodebuild: command not found
為解決此問題而采取的步驟,但仍未解決:
使用fastlane
時有類似的問題。 如果您使用官方指南在 macO 上安裝了 runner,請嘗試打印出 $PATH 變量並檢查其內容。 在我的例子中,它缺少一些我在before_script
塊中添加的路徑,即:
before_script:
- export PATH="/Users/MyUser/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
一定要使用shell執行器和直接macOs安裝,否則runner無法運行
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.