hi
i want create a commande line tool for arm64 et intel x86-64
Xcode 16 macbook pro M3
my setting :
and
but my application compile only for arm64
who can explain to me ?
OK, let’s take a step back. Why are you trying to build all of these architectures? In general, you only want to build x86_64
and arm64
. And you almost never want to build arm64
and arm64e
[1].
If you’re using Xcode then, by default, it’ll build both of the support architectures for a release build. Do this:
-
Create a new project from the macOS > Command-Line Tool template.
-
Choose Product > Archive.
-
In the Xcode organiser, control click on that archive and choose Show in Finder.
-
Open a Terminal window and change to that
.xcarchive
directory. -
Run
file
against the resulting tool:
% file Products/usr/local/bin/Test767593
…/Test767593: Mach-O universal binary with 2 architectures: …
…/Test767593 (for architecture x86_64): Mach-O 64-bit executable x86_64
…/Test767593 (for architecture arm64): Mach-O 64-bit executable arm64
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Apple doesn’t guarantee binary compatibility for arm64e
, except in specific limited circumstances, so the only reason to build it is for testing, and if you’re just testing there’s no need for arm64
as well.