Hello,
I am a newbie on CI/CD bitbucket integration stuff. When I was trying to execute any command related to xcodebuild,(such as clean, build, etc) by specifying it in yml file, it threw me an error "bash: xcodebuild: command not found command not found".
I tried multiple solutions for it but not a single command/Path works for me hence if I get help related to that then that will be helpful or else If I get step-by-step Documentation related to CI/CD iOS with bitbucket integration will also work.
FYI: Checked with the correct Path and required xcodebuild to be in the same directory or not and found they both were at the same level.
MacOS Runners use Bash to run pipeline steps on your MacOS machine (host device), so the builds do not run in Docker containers.
What the runner will do for each step is clone the repo on your machine (unless you have disabled cloning in your bitbucket-pipelines.yml file) and then execute the commands from the step's script. The runner will try to empty the build directory after each step.
If a certain tool is installed on your MacOS machine and you can use it from bash, it should be possible to use it with a MacOS Runner.
If you try the following:
are you then able to run the failing command this way?
Does the command which xcodebuild return any output?
Kind regards,
Theodora
Thanks for the reply, @Theodora Boudale
Unfortunately, I am still facing the same issue. Posting screenshots that might help you to understand where I am failing at:
1. yml file: It started failing from line 18, i.e. xcodebuild clean... command
2. Output that I can see on bitbucket pipeline console:
As I said earlier, I had already committed and can see xcodebuild at the same level directory level where in my installing my pods.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the info.
I can see from both screenshots that you are running this Pipelines build on our own infrastructure. You mentioned in the title iOS pipeline, so I thought you were using a MacOS Runner (this is why I was talking about MacOS Runners in my previous post).
Pipelines that run in Atlassian's infrastructure currently run on a Kubernetes cluster of Linux Docker hosts. I believe that it is not possible to run xcodebuild on a computer that is not a MacOS, so I don't think you'll be able to run this build on our own infrastructure.
If you have a MacOS that you can use to run builds, you can set up a MacOS runner on that machine and run builds there:
The builds will run on your MacOS, but you'll still be able to view the logs on the Bitbucket website on the Pipelines page of the repo. Additionally, you won’t be charged for the build minutes used by your self-hosted runner.
You can see here the Supported platforms and Minimum Requirements for runners:
Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, @Theodora Boudale
Here's a summary of the actions we've tried so far:
Despite implementing the above steps, we still encounter the same error: ie. " BUILD FAILED The following build commands failed: SwiftEmitModule normal arm64 Emitting\ module\ for\ DailyMentor (in target 'DailyMentor' from project 'DailyMentor') (1 failure)"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using a MacOS runner now for the build?
Is the issue reproducible outside of the runner, if you clone the repo and run the commands from your yml file's script?
I don't know what exactly the issue is as I'm not familiar with the tools you are using. If the issue is also reproducible outside the runner, I would suggest reaching out to a forum dedicated to xcode support.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Theodora Boudale
Yes, we are now using MacOS runners. We tried without runner first and there we were getting the "Xcode command not found" error. Then as you mentioned a guided setup for the runner was, we did try that and after that, we are now started getting this issue.
" BUILD FAILED The following build commands failed: SwiftEmitModule normal arm64 Emitting\ module\ for\ DailyMentor (in target 'DailyMentor' from project 'DailyMentor') (1 failure)
So to summarise it:
MacOS Runner: Yes, we are using a MacOS runner for the build process. The build is being performed on a self-hosted MacOS runner provided by Atlassian Pipelines.
Reproducibility: We have tested the build commands from the yml file's script on our local development environment, and the issue is not reproducible there. The build process works as expected when executed locally.
Runner Environment: Considering that the build failure is specific to the runner environment, we suspect that there might be some differences or limitations in the runner setup that are causing the SwiftEmitModule failure.
Dependency on Runner Environment: As we have confirmed that the issue is not occurring outside of the runner environment, it indicates that the problem might be related to the specific runner's configuration or resources.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Akash Ashok Kondekar
Since the macOS runners are executed in a shell session, could you please try executing the same exact commands you have in your pipeline script, but in a shell session outside the runner?
You can open a new terminal window on the same machine that is hosting the runner, and try executing the xcodebuild command directly in that terminal to check if the same error happens. This will help us diagnose whether the issue lies within the host environment itself or on the runner.
Also, I found the following Stackoverflow thread reporting an error similar to the one you are receiving, which might be of help :
Thank you, @Akash Ashok Kondekar !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.
Get Certified! ✍️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.