# Running sonar-scanner on Apple M1 (arm64)

**URL:** <https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920>\
**Category:** SonarQube Server / Community Build\
**Tags:** scanner\
**Created:** [April 10, 2023, 5:45pm UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920 "2023-04-10T17:45:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michalszelagsonos](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/michalszelagsonos/32/31800_2.png) [@michalszelagsonos](https://community.sonarsource.com/u/michalszelagsonos)\
**Post date:** [April 10, 2023, 5:45pm UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920/1 "2023-04-10T17:45:24Z")

</div>

I am curious on the status of when sonar-scanner will be supported on Apple’s M1/M2 arm64 architecture. We’re using Apple’s silicon in CI to build and scan swift and we’re currently using Rosetta to get around the lack of support.

I also have a follow up question. The scanner is essentially a shell wrapper that uses provided x86\_64 JRE to run. Looking at the script, here’s an interesting set of lines from the script:

```bash
use_embedded_jre=true
if ["$use_embedded_jre" = true]; then
  export JAVA_HOME="$sonar_scanner_home/jre"
fi

```

This is forcing the use of the provided x86\_64 JRE. I am curious what the implications would be if I were to disable this and force the use of already installed arm64 JRE? I did try it and the scanner works in our environment but since I didn’t test it across various languages and with different profiles, I suspect the situation is a bit more nuanced.

If this setting were exposed as an option to the user, could this be an option for Apple silicon users for now until the full support is provided? Feature request for the scanner? 😀

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [April 11, 2023, 8:39am UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920/2 "2023-04-11T08:39:03Z")

</div>

Hey there.

If you download the [“any”](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856.zip) flavor of the scanner, you can provide your own JVM.

And, we know that currently C/C++ analysis (using the build wrapper) and Go analysis does not work on Apple Silicon.

More complete support (across languages, Docker images) is on our roadmap!

---

<div class="post-metadata">

**Author:** ![michalszelagsonos](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/michalszelagsonos/32/31800_2.png) [@michalszelagsonos](https://community.sonarsource.com/u/michalszelagsonos)\
**Post date:** [April 11, 2023, 9:28am UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920/3 "2023-04-11T09:28:58Z")

</div>

Oh, didn’t realize there is an **any** flavor, that’s perfect, thanks!

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [April 11, 2023, 11:29am UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920/4 "2023-04-11T11:29:27Z")

</div>

Sure thing! It’s visible on the [SonarScanner CLI](https://docs.sonarqube.org/latest/analyzing-source-code/scanners/sonarscanner/) docs but easy to overlook. Just wanted to point you there in case you need to find it (or a new version) again.

If you run into any limitations I didn’t list before, please let us know. Almost all SonarSourcers using a Mac are using an M1 Mac, and we naturally we run scans every day!

---

<div class="post-metadata">

**Author:** ![ganeshkbalaji](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@ganeshkbalaji](https://community.sonarsource.com/u/ganeshkbalaji)\
**Post date:** [September 14, 2023, 6:50pm UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920/5 "2023-09-14T18:50:43Z")

</div>

Hi Colin,

I have an Objective C / Xcode project that I’m trying to run sonar-scanner with Apple Silicon. I was wondering if this yet supported either using build wrapper or with compilation database.

Thanks

Ganesh

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 15, 2023, 9:36am UTC](https://community.sonarsource.com/t/running-sonar-scanner-on-apple-m1-arm64/88920/6 "2023-09-15T09:36:19Z")

</div>

Hey there.

It is supported using the compilation database.
