I got error when execute macos locally

My Working Environment is … MacOS Catalina (10.15.4)

circleci local execute -c process.yml --job job-ios-build

When i put this line in my terminal, it returns error.

Docker image digest: sha256: --------- (I erased this)
====>> Spin up environment

Build-agent version ()

Creating a dedicated VM with xcode:12.4.0 image

Error: We had an unexpected error preparing a VM for this build, potentially due to our infrastructure or cloud provider. Please retry the build in a few minutes

Error:
Unexpected environment preparation error: failed to create host: remote docker is not available on this installation

Step failed
Task failed

And my config.yml file is organized like this.

version: 2.1
orbs:
    node: circleci/node@4.7.0

executors:
    env-android:
        docker:
            - image: circleci/android:api-29
    env-ios:
        macos:
            xcode: 12.4.0
.....

    job-ios-build:
        executor: env-ios
        steps:
            - initialize
            - install-reactnative-cli
            - ios-restore-cache-npm
            - install-dependencies-npm
            - ios-save-cache-npm
            - npm-build
            - load-cache-pods
            - ios-install-pods
            - ios-apply-patch
            - save-cache-pods
            - xcode-build
            - ios-store-artifacts

workflows:
    make-android-build:
        jobs:
            - job-android-build

    make-ios-build:
        jobs:
            - job-ios-build


If anyone has experienced this, please tell me the solution.

Hi @b1ctory

For using macos builds, we would need to set this directly onto the job itself, rather than declaring as an executor context and then reusing it on the job.

Hence, could you try this instead?

executors:
    env-android:
        docker:
            - image: circleci/android:api-29
-    env-ios:
-        macos:
-            xcode: 12.4.0

jobs:
  job-ios-build:
-   executor: env-ios
+   macos:
+     xcode: 12.4.0
    steps:
      - initialize
      - install-reactnative-cli
      - ios-restore-cache-npm
      - install-dependencies-npm
      - ios-save-cache-npm
      - npm-build
      - load-cache-pods
      - ios-install-pods
      - ios-apply-patch
      - save-cache-pods
      - xcode-build
      - ios-store-artifacts

....

tip

you may like to validate the CircleCI config file before running a local execution :nerd_face:

circleci config validate

Thank you for your response.
I did what you said, but there’s an error like below. :frowning:

ah, it seems that, unfortunately, MacOS jobs are not supported on local runs.

1 Like

:frowning: Ah… i see
Still, thank you for your help. :smiley:

1 Like