doberkofler
doberkofler

Reputation: 10341

Can Xcode build native Intel binaries on a M1 Mac

Is it possible to use Xcode on an M1 Mac to build a native Intel binary? I would like to start testing with the M1 architecture but still continue building native Intel Apps with having to make any changes.

Upvotes: 7

Views: 9630

Answers (1)

jnpdx
jnpdx

Reputation: 52312

Xcode on an M1 Mac will build a Universal Binary, with slices for both x86_64 and arm64.

You can build a universal binary on either an Apple silicon or Intel-based Mac computer, but you cannot debug the arm64 slice of your binary on an Intel-based Mac computer. It’s possible to debug both slices of a universal binary on Apple silicon, but you must run the x86_64 slice under Rosetta translation.

Source: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary

In many cases, this results in code that can be compiled for both architectures without any changes, but there are compiler flags (listed on the same page linked above) if you need to do conditional compilation.

Upvotes: 9

Related Questions